Skip to content

Commit 55e65cd

Browse files
committed
Style pre-commit
1 parent e6b3901 commit 55e65cd

File tree

13 files changed

+473
-319
lines changed

13 files changed

+473
-319
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ docs/_build
1818
docs/html
1919
.eggs
2020
env/
21+
.tox
2122

2223
# Editors
2324
.idea

.pre-commit-config.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
repos:
3+
- repo: https://github.com/asottile/pyupgrade
4+
rev: v2.2.1
5+
hooks:
6+
- id: pyupgrade
7+
args: ["--py36-plus"]
8+
- repo: https://github.com/asottile/reorder_python_imports
9+
rev: v2.2.0
10+
hooks:
11+
- id: reorder-python-imports
12+
args: ["--application-directories", "src"]
13+
- repo: https://github.com/psf/black
14+
rev: 19.10b0
15+
hooks:
16+
- id: black
17+
- repo: https://gitlab.com/pycqa/flake8
18+
rev: 3.7.9
19+
hooks:
20+
- id: flake8
21+
additional_dependencies:
22+
- flake8-bugbear
23+
- flake8-implicit-str-concat
24+
- repo: https://github.com/pre-commit/pre-commit-hooks
25+
rev: v2.5.0
26+
hooks:
27+
- id: check-byte-order-marker
28+
- id: trailing-whitespace
29+
- id: end-of-file-fixer

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Unreleased
2828
- Check for ``sqlalchemy.`` to avoid matching packages with names starting
2929
with ``sqlalchemy`` (6237a0f_)
3030
- Use SQLAlchemy's Column.doc for WTForm's Field.description (`#21`_)
31+
- Style pre-commit (`#624`_)
3132

3233
.. _#2: https://github.com/wtforms/wtforms-sqlalchemy/pull/2
3334
.. _#3: https://github.com/wtforms/wtforms-sqlalchemy/pull/3
@@ -41,6 +42,7 @@ Unreleased
4142
.. _#17: https://github.com/wtforms/wtforms-sqlalchemy/pull/17
4243
.. _6237a0f: https://github.com/wtforms/wtforms-sqlalchemy/commit/6237a0f9e53ec5f22048be7f129e29f7f1c58448
4344
.. _#21: https://github.com/wtforms/wtforms-sqlalchemy/pull/21
45+
.. _#624: https://github.com/wtforms/wtforms-sqlalchemy/pull/624
4446

4547
Version 0.1
4648
-----------

docs/conf.py

Lines changed: 83 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# -*- coding: utf-8 -*-
21
#
32
# WTForms-SQLAlchemy documentation build configuration file, created by
43
# sphinx-quickstart on Sun Nov 10 16:35:07 2013.
@@ -10,215 +9,223 @@
109
#
1110
# All configuration values have a default; values that are commented out
1211
# serve to show the default.
13-
14-
import sys, os
12+
import os
13+
import sys
1514

1615
# If extensions (or modules to document with autodoc) are in another directory,
1716
# add these directories to sys.path here. If the directory is relative to the
1817
# documentation root, use os.path.abspath to make it absolute, like shown here.
19-
sys.path.insert(0, os.path.abspath('..'))
18+
sys.path.insert(0, os.path.abspath(".."))
2019

2120
# -- General configuration -----------------------------------------------------
2221

2322
# If your documentation needs a minimal Sphinx version, state it here.
24-
#needs_sphinx = '1.0'
23+
# needs_sphinx = '1.0'
2524

2625
# Add any Sphinx extension module names here, as strings. They can be extensions
2726
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
28-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.coverage']
27+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.doctest", "sphinx.ext.coverage"]
2928

3029
# Add any paths that contain templates here, relative to this directory.
31-
templates_path = ['_templates']
30+
templates_path = ["_templates"]
3231

3332
# The suffix of source filenames.
34-
source_suffix = '.rst'
33+
source_suffix = ".rst"
3534

3635
# The encoding of source files.
37-
#source_encoding = 'utf-8-sig'
36+
# source_encoding = 'utf-8-sig'
3837

3938
# The master toctree document.
40-
master_doc = 'index'
39+
master_doc = "index"
4140

4241
# General information about the project.
43-
project = u'WTForms-SQLAlchemy'
44-
copyright = u'2014, WTForms Team'
42+
project = "WTForms-SQLAlchemy"
43+
copyright = "2014, WTForms Team"
4544

4645
# The version info for the project you're documenting, acts as replacement for
4746
# |version| and |release|, also used in various other places throughout the
4847
# built documents.
4948
#
5049
# The short X.Y version.
51-
version = '0.2'
50+
version = "0.2"
5251
# The full version, including alpha/beta/rc tags.
53-
release = '0.2dev'
52+
release = "0.2dev"
5453

5554
# The language for content autogenerated by Sphinx. Refer to documentation
5655
# for a list of supported languages.
57-
#language = None
56+
# language = None
5857

5958
# There are two options for replacing |today|: either, you set today to some
6059
# non-false value, then it is used:
61-
#today = ''
60+
# today = ''
6261
# Else, today_fmt is used as the format for a strftime call.
63-
#today_fmt = '%B %d, %Y'
62+
# today_fmt = '%B %d, %Y'
6463

6564
# List of patterns, relative to source directory, that match files and
6665
# directories to ignore when looking for source files.
67-
exclude_patterns = ['_build']
66+
exclude_patterns = ["_build"]
6867

6968
# The reST default role (used for this markup: `text`) to use for all documents.
70-
#default_role = None
69+
# default_role = None
7170

7271
# If true, '()' will be appended to :func: etc. cross-reference text.
73-
#add_function_parentheses = True
72+
# add_function_parentheses = True
7473

7574
# If true, the current module name will be prepended to all description
7675
# unit titles (such as .. function::).
77-
#add_module_names = True
76+
# add_module_names = True
7877

7978
# If true, sectionauthor and moduleauthor directives will be shown in the
8079
# output. They are ignored by default.
81-
#show_authors = False
80+
# show_authors = False
8281

8382
# The name of the Pygments (syntax highlighting) style to use.
84-
pygments_style = 'sphinx'
83+
pygments_style = "sphinx"
8584

8685
# A list of ignored prefixes for module index sorting.
87-
#modindex_common_prefix = []
86+
# modindex_common_prefix = []
8887

8988

9089
# -- Options for HTML output ---------------------------------------------------
9190

9291
# The theme to use for HTML and HTML Help pages. See the documentation for
9392
# a list of builtin themes.
94-
html_theme = 'default'
93+
html_theme = "default"
9594

9695
# Theme options are theme-specific and customize the look and feel of a theme
9796
# further. For a list of options available for each theme, see the
9897
# documentation.
99-
#html_theme_options = {}
98+
# html_theme_options = {}
10099

101100
# Add any paths that contain custom themes here, relative to this directory.
102-
#html_theme_path = []
101+
# html_theme_path = []
103102

104103
# The name for this set of Sphinx documents. If None, it defaults to
105104
# "<project> v<release> documentation".
106-
#html_title = None
105+
# html_title = None
107106

108107
# A shorter title for the navigation bar. Default is the same as html_title.
109-
#html_short_title = None
108+
# html_short_title = None
110109

111110
# The name of an image file (relative to this directory) to place at the top
112111
# of the sidebar.
113-
#html_logo = None
112+
# html_logo = None
114113

115114
# The name of an image file (within the static path) to use as favicon of the
116115
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
117116
# pixels large.
118-
#html_favicon = None
117+
# html_favicon = None
119118

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

125124
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
126125
# using the given strftime format.
127-
#html_last_updated_fmt = '%b %d, %Y'
126+
# html_last_updated_fmt = '%b %d, %Y'
128127

129128
# If true, SmartyPants will be used to convert quotes and dashes to
130129
# typographically correct entities.
131-
#html_use_smartypants = True
130+
# html_use_smartypants = True
132131

133132
# Custom sidebar templates, maps document names to template names.
134-
#html_sidebars = {}
133+
# html_sidebars = {}
135134

136135
# Additional templates that should be rendered to pages, maps page names to
137136
# template names.
138-
#html_additional_pages = {}
137+
# html_additional_pages = {}
139138

140139
# If false, no module index is generated.
141-
#html_domain_indices = True
140+
# html_domain_indices = True
142141

143142
# If false, no index is generated.
144-
#html_use_index = True
143+
# html_use_index = True
145144

146145
# If true, the index is split into individual pages for each letter.
147-
#html_split_index = False
146+
# html_split_index = False
148147

149148
# If true, links to the reST sources are added to the pages.
150-
#html_show_sourcelink = True
149+
# html_show_sourcelink = True
151150

152151
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
153-
#html_show_sphinx = True
152+
# html_show_sphinx = True
154153

155154
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
156-
#html_show_copyright = True
155+
# html_show_copyright = True
157156

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

163162
# This is the file name suffix for HTML files (e.g. ".xhtml").
164-
#html_file_suffix = None
163+
# html_file_suffix = None
165164

166165
# Output file base name for HTML help builder.
167-
htmlhelp_basename = 'WTForms-SQLAlchemydoc'
166+
htmlhelp_basename = "WTForms-SQLAlchemydoc"
168167

169168

170169
# -- Options for LaTeX output --------------------------------------------------
171170

172171
latex_elements = {
173-
# The paper size ('letterpaper' or 'a4paper').
174-
#'papersize': 'letterpaper',
175-
176-
# The font size ('10pt', '11pt' or '12pt').
177-
#'pointsize': '10pt',
178-
179-
# Additional stuff for the LaTeX preamble.
180-
#'preamble': '',
172+
# The paper size ('letterpaper' or 'a4paper').
173+
# 'papersize': 'letterpaper',
174+
# The font size ('10pt', '11pt' or '12pt').
175+
# 'pointsize': '10pt',
176+
# Additional stuff for the LaTeX preamble.
177+
# 'preamble': '',
181178
}
182179

183180
# Grouping the document tree into LaTeX files. List of tuples
184181
# (source start file, target name, title, author, documentclass [howto/manual]).
185182
latex_documents = [
186-
('index', 'WTForms-SQLAlchemy.tex', u'WTForms-SQLAlchemy Documentation',
187-
u'WTForms Team', 'manual'),
183+
(
184+
"index",
185+
"WTForms-SQLAlchemy.tex",
186+
"WTForms-SQLAlchemy Documentation",
187+
"WTForms Team",
188+
"manual",
189+
),
188190
]
189191

190192
# The name of an image file (relative to this directory) to place at the top of
191193
# the title page.
192-
#latex_logo = None
194+
# latex_logo = None
193195

194196
# For "manual" documents, if this is true, then toplevel headings are parts,
195197
# not chapters.
196-
#latex_use_parts = False
198+
# latex_use_parts = False
197199

198200
# If true, show page references after internal links.
199-
#latex_show_pagerefs = False
201+
# latex_show_pagerefs = False
200202

201203
# If true, show URL addresses after external links.
202-
#latex_show_urls = False
204+
# latex_show_urls = False
203205

204206
# Documents to append as an appendix to all manuals.
205-
#latex_appendices = []
207+
# latex_appendices = []
206208

207209
# If false, no module index is generated.
208-
#latex_domain_indices = True
210+
# latex_domain_indices = True
209211

210212

211213
# -- Options for manual page output --------------------------------------------
212214

213215
# One entry per manual page. List of tuples
214216
# (source start file, name, description, authors, manual section).
215217
man_pages = [
216-
('index', 'wtforms-sqlalchemy', u'WTForms-SQLAlchemy Documentation',
217-
[u'WTForms Team'], 1)
218+
(
219+
"index",
220+
"wtforms-sqlalchemy",
221+
"WTForms-SQLAlchemy Documentation",
222+
["WTForms Team"],
223+
1,
224+
)
218225
]
219226

220227
# If true, show URL addresses after external links.
221-
#man_show_urls = False
228+
# man_show_urls = False
222229

223230

224231
# -- Options for Texinfo output ------------------------------------------------
@@ -227,16 +234,22 @@
227234
# (source start file, target name, title, author,
228235
# dir menu entry, description, category)
229236
texinfo_documents = [
230-
('index', 'WTForms-SQLAlchemy', u'WTForms-SQLAlchemy Documentation',
231-
u'WTForms Team', 'WTForms-SQLAlchemy', 'One line description of project.',
232-
'Miscellaneous'),
237+
(
238+
"index",
239+
"WTForms-SQLAlchemy",
240+
"WTForms-SQLAlchemy Documentation",
241+
"WTForms Team",
242+
"WTForms-SQLAlchemy",
243+
"One line description of project.",
244+
"Miscellaneous",
245+
),
233246
]
234247

235248
# Documents to append as an appendix to all manuals.
236-
#texinfo_appendices = []
249+
# texinfo_appendices = []
237250

238251
# If false, no module index is generated.
239-
#texinfo_domain_indices = True
252+
# texinfo_domain_indices = True
240253

241254
# How to display URL addresses: 'footnote', 'no', or 'inline'.
242-
#texinfo_show_urls = 'footnote'
255+
# texinfo_show_urls = 'footnote'

docs/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ Indices and tables
2020
* :ref:`genindex`
2121
* :ref:`modindex`
2222
* :ref:`search`
23-

0 commit comments

Comments
 (0)