Skip to content

Commit 61aeedc

Browse files
committed
adding ruff, changing version of documentation, adding pre-commit
1 parent 962c73c commit 61aeedc

10 files changed

Lines changed: 506 additions & 284 deletions

File tree

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
repos:
2+
- repo: https://github.com/astral-sh/ruff-pre-commit
3+
rev: v0.11.10
4+
hooks:
5+
- id: ruff
6+
- id: ruff-format

docs/conf.py

Lines changed: 48 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
import os
2121
import sys
2222

23-
on_rtd = os.environ.get('READTHEDOCS') == 'True'
24-
sys.path.insert(0, os.path.abspath('..'))
23+
on_rtd = os.environ.get("READTHEDOCS") == "True"
24+
sys.path.insert(0, os.path.abspath(".."))
2525

2626
if on_rtd:
27-
html_theme = 'default'
27+
html_theme = "default"
2828
else:
29-
html_theme = 'nature'
29+
html_theme = "nature"
3030

3131
# -- General configuration ------------------------------------------------
3232

@@ -37,33 +37,33 @@
3737
# Add any Sphinx extension module names here, as strings. They can be
3838
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3939
# ones.
40-
extensions = ['sphinx.ext.autodoc']
40+
extensions = ["sphinx.ext.autodoc"]
4141

4242
# Add any paths that contain templates here, relative to this directory.
43-
templates_path = ['_templates']
43+
templates_path = ["_templates"]
4444

4545
# The suffix(es) of source filenames.
4646
# You can specify multiple suffix as a list of string:
4747
#
4848
# source_suffix = ['.rst', '.md']
49-
source_suffix = '.rst'
49+
source_suffix = ".rst"
5050

5151
# The master toctree document.
52-
master_doc = 'index'
52+
master_doc = "index"
5353

5454
# General information about the project.
55-
project = 'Python Namesilo Module'
56-
copyright = '2018, Goran Vrbaški'
57-
author = 'Goran Vrbaški'
55+
project = "Python Namesilo Module"
56+
copyright = "2026, Goran Vrbaški"
57+
author = "Goran Vrbaški"
5858

5959
# The version info for the project you're documenting, acts as replacement for
6060
# |version| and |release|, also used in various other places throughout the
6161
# built documents.
6262
#
6363
# The short X.Y version.
64-
version = '1.1.2'
64+
version = "2.0.0"
6565
# The full version, including alpha/beta/rc tags.
66-
release = '1.1.2'
66+
release = "2.0.0"
6767

6868
# The language for content autogenerated by Sphinx. Refer to documentation
6969
# for a list of supported languages.
@@ -75,10 +75,10 @@
7575
# List of patterns, relative to source directory, that match files and
7676
# directories to ignore when looking for source files.
7777
# This patterns also effect to html_static_path and html_extra_path
78-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
78+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7979

8080
# The name of the Pygments (syntax highlighting) style to use.
81-
pygments_style = 'sphinx'
81+
pygments_style = "sphinx"
8282

8383
# If true, `todo` and `todoList` produce output, else they produce nothing.
8484
todo_include_todos = False
@@ -89,7 +89,7 @@
8989
# The theme to use for HTML and HTML Help pages. See the documentation for
9090
# a list of builtin themes.
9191
#
92-
html_theme = 'sphinx_rtd_theme'
92+
html_theme = "sphinx_rtd_theme"
9393

9494
# Theme options are theme-specific and customize the look and feel of a theme
9595
# further. For a list of options available for each theme, see the
@@ -100,28 +100,28 @@
100100
# Add any paths that contain custom static files (such as style sheets) here,
101101
# relative to this directory. They are copied after the builtin static files,
102102
# so a file named "default.css" will overwrite the builtin "default.css".
103-
html_static_path = ['_static']
103+
html_static_path = ["_static"]
104104

105105
# Custom sidebar templates, must be a dictionary that maps document names
106106
# to template names.
107107
#
108108
# This is required for the alabaster theme
109109
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
110110
html_sidebars = {
111-
'**': [
112-
'about.html',
113-
'navigation.html',
114-
'relations.html', # needs 'show_related': True theme option to display
115-
'searchbox.html',
116-
'donate.html',
111+
"**": [
112+
"about.html",
113+
"navigation.html",
114+
"relations.html", # needs 'show_related': True theme option to display
115+
"searchbox.html",
116+
"donate.html",
117117
]
118118
}
119119

120120

121121
# -- Options for HTMLHelp output ------------------------------------------
122122

123123
# Output file base name for HTML help builder.
124-
htmlhelp_basename = 'PythonNamesiloModuledoc'
124+
htmlhelp_basename = "PythonNamesiloModuledoc"
125125

126126

127127
# -- Options for LaTeX output ---------------------------------------------
@@ -130,15 +130,12 @@
130130
# The paper size ('letterpaper' or 'a4paper').
131131
#
132132
# 'papersize': 'letterpaper',
133-
134133
# The font size ('10pt', '11pt' or '12pt').
135134
#
136135
# 'pointsize': '10pt',
137-
138136
# Additional stuff for the LaTeX preamble.
139137
#
140138
# 'preamble': '',
141-
142139
# Latex figure (float) alignment
143140
#
144141
# 'figure_align': 'htbp',
@@ -148,8 +145,13 @@
148145
# (source start file, target name, title,
149146
# author, documentclass [howto, manual, or own class]).
150147
latex_documents = [
151-
(master_doc, 'PythonNamesiloModule.tex', 'Python Namesilo Module Documentation',
152-
'Goran Vrbaski', 'manual'),
148+
(
149+
master_doc,
150+
"PythonNamesiloModule.tex",
151+
"Python Namesilo Module Documentation",
152+
"Goran Vrbaski",
153+
"manual",
154+
),
153155
]
154156

155157

@@ -158,8 +160,13 @@
158160
# One entry per manual page. List of tuples
159161
# (source start file, name, description, authors, manual section).
160162
man_pages = [
161-
(master_doc, 'pythonnamesilomodule', 'Python Namesilo Module Documentation',
162-
[author], 1)
163+
(
164+
master_doc,
165+
"pythonnamesilomodule",
166+
"Python Namesilo Module Documentation",
167+
[author],
168+
1,
169+
)
163170
]
164171

165172

@@ -169,9 +176,15 @@
169176
# (source start file, target name, title, author,
170177
# dir menu entry, description, category)
171178
texinfo_documents = [
172-
(master_doc, 'PythonNamesiloModule', 'Python Namesilo Module Documentation',
173-
author, 'PythonNamesiloModule', 'One line description of project.',
174-
'Miscellaneous'),
179+
(
180+
master_doc,
181+
"PythonNamesiloModule",
182+
"Python Namesilo Module Documentation",
183+
author,
184+
"PythonNamesiloModule",
185+
"One line description of project.",
186+
"Miscellaneous",
187+
),
175188
]
176189

177-
autoclass_content = 'both'
190+
autoclass_content = "both"

namesilo/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__author__ = 'goran.vrbaski'
1+
__author__ = "goran.vrbaski"

namesilo/common/models.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
from datetime import datetime
22
from dataclasses import dataclass
33

4-
__author__ = 'goran.vrbaski'
4+
__author__ = "goran.vrbaski"
55

66
from typing import List
77

88

99
class Contact:
1010
def __init__(self, data):
11-
self.administrative = data['administrative']
12-
self.billing = data['billing']
13-
self.registrant = data['registrant']
14-
self.technical = data['technical']
11+
self.administrative = data["administrative"]
12+
self.billing = data["billing"]
13+
self.registrant = data["registrant"]
14+
self.technical = data["technical"]
1515

1616

1717
@dataclass
@@ -60,11 +60,10 @@ def from_api(cls, data: dict) -> "DomainInfo":
6060
)
6161

6262

63-
6463
class NameServers:
6564
@staticmethod
6665
def process(data):
6766
ns_list = []
6867
for name_server in data:
69-
ns_list.append(name_server['nameserver'])
68+
ns_list.append(name_server["nameserver"])
7069
return ns_list

0 commit comments

Comments
 (0)