Skip to content

Commit 7a7caf8

Browse files
committed
[Ref] add pre-commit and fix all files
1 parent 7c074fa commit 7a7caf8

File tree

16 files changed

+217
-181
lines changed

16 files changed

+217
-181
lines changed

.pre-commit-config.yaml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- repo: https://github.com/psf/black
9+
rev: 22.3.0
10+
hooks:
11+
- id: black

CONTRIBUTING.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributing
33
============
44

55
Contributions are welcome, and they are greatly appreciated! Every
6-
little bit helps, and credit will always be given.
6+
little bit helps, and credit will always be given.
77

88
You can contribute in many ways:
99

@@ -36,7 +36,7 @@ is open to whoever wants to implement it.
3636
Write Documentation
3737
~~~~~~~~~~~~~~~~~~~
3838

39-
Django Db Comments could always use more documentation, whether as part of the
39+
Django Db Comments could always use more documentation, whether as part of the
4040
official Django Db Comments docs, in docstrings, or even on the web in blog posts,
4141
articles, and such.
4242

@@ -81,7 +81,7 @@ Ready to contribute? Here's how to set up `django-db-comments` for local develop
8181
$ python setup.py test
8282
$ tox
8383

84-
To get flake8 and tox, just pip install them into your virtualenv.
84+
To get flake8 and tox, just pip install them into your virtualenv.
8585

8686
6. Commit your changes and push your branch to GitHub::
8787

@@ -100,7 +100,7 @@ Before you submit a pull request, check that it meets these guidelines:
100100
2. If the pull request adds functionality, the docs should be updated. Put
101101
your new functionality into a function with a docstring, and add the
102102
feature to the list in README.rst.
103-
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check
103+
3. The pull request should work for Python 2.6, 2.7, and 3.3, and for PyPy. Check
104104
https://travis-ci.org/vanadium23/django-db-comments/pull_requests
105105
and make sure that the tests pass for all supported Python versions.
106106

LICENSE

-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,3 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
88
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
99

1010
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
11-
12-
13-
14-

django_db_comments/__init__.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
__version__ = '0.4.1'
1+
__version__ = "0.4.1"
22

3-
default_app_config = 'django_db_comments.apps.DjangoDbCommentsConfig'
3+
default_app_config = "django_db_comments.apps.DjangoDbCommentsConfig"

docs/conf.py

+81-67
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# If extensions (or modules to document with autodoc) are in another directory,
1717
# add these directories to sys.path here. If the directory is relative to the
1818
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
#sys.path.insert(0, os.path.abspath('.'))
19+
# sys.path.insert(0, os.path.abspath('.'))
2020

2121
cwd = os.getcwd()
2222
parent = os.path.dirname(cwd)
@@ -27,27 +27,27 @@
2727
# -- General configuration -----------------------------------------------------
2828

2929
# If your documentation needs a minimal Sphinx version, state it here.
30-
#needs_sphinx = '1.0'
30+
# needs_sphinx = '1.0'
3131

3232
# Add any Sphinx extension module names here, as strings. They can be extensions
3333
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
34-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
34+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
3535

3636
# Add any paths that contain templates here, relative to this directory.
37-
templates_path = ['_templates']
37+
templates_path = ["_templates"]
3838

3939
# The suffix of source filenames.
40-
source_suffix = '.rst'
40+
source_suffix = ".rst"
4141

4242
# The encoding of source files.
43-
#source_encoding = 'utf-8-sig'
43+
# source_encoding = 'utf-8-sig'
4444

4545
# The master toctree document.
46-
master_doc = 'index'
46+
master_doc = "index"
4747

4848
# General information about the project.
49-
project = u'django_db_comments'
50-
copyright = u'2019, Ivan Chernov'
49+
project = "django_db_comments"
50+
copyright = "2019, Ivan Chernov"
5151

5252
# The version info for the project you're documenting, acts as replacement for
5353
# |version| and |release|, also used in various other places throughout the
@@ -60,174 +60,182 @@
6060

6161
# The language for content autogenerated by Sphinx. Refer to documentation
6262
# for a list of supported languages.
63-
#language = None
63+
# language = None
6464

6565
# There are two options for replacing |today|: either, you set today to some
6666
# non-false value, then it is used:
67-
#today = ''
67+
# today = ''
6868
# Else, today_fmt is used as the format for a strftime call.
69-
#today_fmt = '%B %d, %Y'
69+
# today_fmt = '%B %d, %Y'
7070

7171
# List of patterns, relative to source directory, that match files and
7272
# directories to ignore when looking for source files.
73-
exclude_patterns = ['_build']
73+
exclude_patterns = ["_build"]
7474

7575
# The reST default role (used for this markup: `text`) to use for all documents.
76-
#default_role = None
76+
# default_role = None
7777

7878
# If true, '()' will be appended to :func: etc. cross-reference text.
79-
#add_function_parentheses = True
79+
# add_function_parentheses = True
8080

8181
# If true, the current module name will be prepended to all description
8282
# unit titles (such as .. function::).
83-
#add_module_names = True
83+
# add_module_names = True
8484

8585
# If true, sectionauthor and moduleauthor directives will be shown in the
8686
# output. They are ignored by default.
87-
#show_authors = False
87+
# show_authors = False
8888

8989
# The name of the Pygments (syntax highlighting) style to use.
90-
pygments_style = 'sphinx'
90+
pygments_style = "sphinx"
9191

9292
# A list of ignored prefixes for module index sorting.
93-
#modindex_common_prefix = []
93+
# modindex_common_prefix = []
9494

9595
# If true, keep warnings as "system message" paragraphs in the built documents.
96-
#keep_warnings = False
96+
# keep_warnings = False
9797

9898

9999
# -- Options for HTML output ---------------------------------------------------
100100

101101
# The theme to use for HTML and HTML Help pages. See the documentation for
102102
# a list of builtin themes.
103-
html_theme = 'default'
103+
html_theme = "default"
104104

105105
# Theme options are theme-specific and customize the look and feel of a theme
106106
# further. For a list of options available for each theme, see the
107107
# documentation.
108-
#html_theme_options = {}
108+
# html_theme_options = {}
109109

110110
# Add any paths that contain custom themes here, relative to this directory.
111-
#html_theme_path = []
111+
# html_theme_path = []
112112

113113
# The name for this set of Sphinx documents. If None, it defaults to
114114
# "<project> v<release> documentation".
115-
#html_title = None
115+
# html_title = None
116116

117117
# A shorter title for the navigation bar. Default is the same as html_title.
118-
#html_short_title = None
118+
# html_short_title = None
119119

120120
# The name of an image file (relative to this directory) to place at the top
121121
# of the sidebar.
122-
#html_logo = None
122+
# html_logo = None
123123

124124
# The name of an image file (within the static path) to use as favicon of the
125125
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
126126
# pixels large.
127-
#html_favicon = None
127+
# html_favicon = None
128128

129129
# Add any paths that contain custom static files (such as style sheets) here,
130130
# relative to this directory. They are copied after the builtin static files,
131131
# so a file named "default.css" will overwrite the builtin "default.css".
132-
html_static_path = ['_static']
132+
html_static_path = ["_static"]
133133

134134
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
135135
# using the given strftime format.
136-
#html_last_updated_fmt = '%b %d, %Y'
136+
# html_last_updated_fmt = '%b %d, %Y'
137137

138138
# If true, SmartyPants will be used to convert quotes and dashes to
139139
# typographically correct entities.
140-
#html_use_smartypants = True
140+
# html_use_smartypants = True
141141

142142
# Custom sidebar templates, maps document names to template names.
143-
#html_sidebars = {}
143+
# html_sidebars = {}
144144

145145
# Additional templates that should be rendered to pages, maps page names to
146146
# template names.
147-
#html_additional_pages = {}
147+
# html_additional_pages = {}
148148

149149
# If false, no module index is generated.
150-
#html_domain_indices = True
150+
# html_domain_indices = True
151151

152152
# If false, no index is generated.
153-
#html_use_index = True
153+
# html_use_index = True
154154

155155
# If true, the index is split into individual pages for each letter.
156-
#html_split_index = False
156+
# html_split_index = False
157157

158158
# If true, links to the reST sources are added to the pages.
159-
#html_show_sourcelink = True
159+
# html_show_sourcelink = True
160160

161161
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
162-
#html_show_sphinx = True
162+
# html_show_sphinx = True
163163

164164
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
165-
#html_show_copyright = True
165+
# html_show_copyright = True
166166

167167
# If true, an OpenSearch description file will be output, and all pages will
168168
# contain a <link> tag referring to it. The value of this option must be the
169169
# base URL from which the finished HTML is served.
170-
#html_use_opensearch = ''
170+
# html_use_opensearch = ''
171171

172172
# This is the file name suffix for HTML files (e.g. ".xhtml").
173-
#html_file_suffix = None
173+
# html_file_suffix = None
174174

175175
# Output file base name for HTML help builder.
176-
htmlhelp_basename = 'django-db-commentsdoc'
176+
htmlhelp_basename = "django-db-commentsdoc"
177177

178178

179179
# -- Options for LaTeX output --------------------------------------------------
180180

181181
latex_elements = {
182-
# The paper size ('letterpaper' or 'a4paper').
183-
#'papersize': 'letterpaper',
184-
185-
# The font size ('10pt', '11pt' or '12pt').
186-
#'pointsize': '10pt',
187-
188-
# Additional stuff for the LaTeX preamble.
189-
#'preamble': '',
182+
# The paper size ('letterpaper' or 'a4paper').
183+
#'papersize': 'letterpaper',
184+
# The font size ('10pt', '11pt' or '12pt').
185+
#'pointsize': '10pt',
186+
# Additional stuff for the LaTeX preamble.
187+
#'preamble': '',
190188
}
191189

192190
# Grouping the document tree into LaTeX files. List of tuples
193191
# (source start file, target name, title, author, documentclass [howto/manual]).
194192
latex_documents = [
195-
('index', 'django-db-comments.tex', u'django_db_comments Documentation',
196-
u'Ivan Chernov', 'manual'),
193+
(
194+
"index",
195+
"django-db-comments.tex",
196+
"django_db_comments Documentation",
197+
"Ivan Chernov",
198+
"manual",
199+
),
197200
]
198201

199202
# The name of an image file (relative to this directory) to place at the top of
200203
# the title page.
201-
#latex_logo = None
204+
# latex_logo = None
202205

203206
# For "manual" documents, if this is true, then toplevel headings are parts,
204207
# not chapters.
205-
#latex_use_parts = False
208+
# latex_use_parts = False
206209

207210
# If true, show page references after internal links.
208-
#latex_show_pagerefs = False
211+
# latex_show_pagerefs = False
209212

210213
# If true, show URL addresses after external links.
211-
#latex_show_urls = False
214+
# latex_show_urls = False
212215

213216
# Documents to append as an appendix to all manuals.
214-
#latex_appendices = []
217+
# latex_appendices = []
215218

216219
# If false, no module index is generated.
217-
#latex_domain_indices = True
220+
# latex_domain_indices = True
218221

219222

220223
# -- Options for manual page output --------------------------------------------
221224

222225
# One entry per manual page. List of tuples
223226
# (source start file, name, description, authors, manual section).
224227
man_pages = [
225-
('index', 'django-db-comments', u'django_db_comments Documentation',
226-
[u'Ivan Chernov'], 1)
228+
(
229+
"index",
230+
"django-db-comments",
231+
"django_db_comments Documentation",
232+
["Ivan Chernov"],
233+
1,
234+
)
227235
]
228236

229237
# If true, show URL addresses after external links.
230-
#man_show_urls = False
238+
# man_show_urls = False
231239

232240

233241
# -- Options for Texinfo output ------------------------------------------------
@@ -236,19 +244,25 @@
236244
# (source start file, target name, title, author,
237245
# dir menu entry, description, category)
238246
texinfo_documents = [
239-
('index', 'django-db-comments', u'django_db_comments Documentation',
240-
u'Ivan Chernov', 'django-db-comments', 'One line description of project.',
241-
'Miscellaneous'),
247+
(
248+
"index",
249+
"django-db-comments",
250+
"django_db_comments Documentation",
251+
"Ivan Chernov",
252+
"django-db-comments",
253+
"One line description of project.",
254+
"Miscellaneous",
255+
),
242256
]
243257

244258
# Documents to append as an appendix to all manuals.
245-
#texinfo_appendices = []
259+
# texinfo_appendices = []
246260

247261
# If false, no module index is generated.
248-
#texinfo_domain_indices = True
262+
# texinfo_domain_indices = True
249263

250264
# How to display URL addresses: 'footnote', 'no', or 'inline'.
251-
#texinfo_show_urls = 'footnote'
265+
# texinfo_show_urls = 'footnote'
252266

253267
# If true, do not generate a @detailmenu in the "Top" node's menu.
254-
#texinfo_no_detailmenu = False
268+
# texinfo_no_detailmenu = False

example/README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ To run this example, follow these instructions:
88

99
1. Navigate to the `example` directory
1010
2. Install the requirements for the package:
11-
11+
1212
pip install -r requirements.txt
13-
13+
1414
3. Make and apply migrations
1515

1616
python manage.py makemigrations
17-
17+
1818
python manage.py migrate
19-
19+
2020
4. Run the server
2121

2222
python manage.py runserver
23-
23+
2424
5. Access from the browser at `http://127.0.0.1:8000`

0 commit comments

Comments
 (0)