Skip to content

Commit 51de0fa

Browse files
authored
Merge pull request #1028 from asottile/add_simple_pre_commit_config
add simple .pre-commit-config.yaml
2 parents 533073e + e2eaea8 commit 51de0fa

File tree

4 files changed

+61
-47
lines changed

4 files changed

+61
-47
lines changed

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
exclude: ^testsuite/
2+
repos:
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.0.1
5+
hooks:
6+
- id: check-yaml
7+
- id: debug-statements
8+
- id: end-of-file-fixer
9+
- id: trailing-whitespace
10+
- repo: https://github.com/asottile/reorder_python_imports
11+
rev: v2.6.0
12+
hooks:
13+
- id: reorder-python-imports
14+
- repo: https://github.com/pycqa/flake8
15+
rev: 3.9.2
16+
hooks:
17+
- id: flake8

docs/conf.py

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@
1111
#
1212
# All configuration values have a default; values that are commented out
1313
# serve to show the default.
14-
15-
import sys
1614
import os
15+
import sys
1716

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

2423
# -- General configuration ----------------------------------------------------
2524

2625
# If your documentation needs a minimal Sphinx version, state it here.
27-
#needs_sphinx = '1.0'
26+
# needs_sphinx = '1.0'
2827

2928
# Add any Sphinx extension module names here, as strings. They can be
3029
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -38,7 +37,7 @@
3837
source_suffix = '.rst'
3938

4039
# The encoding of source files.
41-
#source_encoding = 'utf-8-sig'
40+
# source_encoding = 'utf-8-sig'
4241

4342
# The master toctree document.
4443
master_doc = 'index'
@@ -61,38 +60,38 @@
6160

6261
# The language for content autogenerated by Sphinx. Refer to documentation
6362
# for a list of supported languages.
64-
#language = None
63+
# language = None
6564

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

7271
# List of patterns, relative to source directory, that match files and
7372
# directories to ignore when looking for source files.
7473
exclude_patterns = ['_build']
7574

7675
# The reST default role (used for this markup: `text`) to use for
7776
# all documents.
78-
#default_role = None
77+
# default_role = None
7978

8079
# If true, '()' will be appended to :func: etc. cross-reference text.
81-
#add_function_parentheses = True
80+
# add_function_parentheses = True
8281

8382
# If true, the current module name will be prepended to all description
8483
# unit titles (such as .. function::).
85-
#add_module_names = True
84+
# add_module_names = True
8685

8786
# If true, sectionauthor and moduleauthor directives will be shown in the
8887
# output. They are ignored by default.
89-
#show_authors = False
88+
# show_authors = False
9089

9190
# The name of the Pygments (syntax highlighting) style to use.
9291
pygments_style = 'sphinx'
9392

9493
# A list of ignored prefixes for module index sorting.
95-
#modindex_common_prefix = []
94+
# modindex_common_prefix = []
9695

9796

9897
# -- Options for HTML output --------------------------------------------------
@@ -108,26 +107,26 @@
108107
# Theme options are theme-specific and customize the look and feel of a theme
109108
# further. For a list of options available for each theme, see the
110109
# documentation.
111-
#html_theme_options = {}
110+
# html_theme_options = {}
112111

113112
# Add any paths that contain custom themes here, relative to this directory.
114-
#html_theme_path = []
113+
# html_theme_path = []
115114

116115
# The name for this set of Sphinx documents. If None, it defaults to
117116
# "<project> v<release> documentation".
118-
#html_title = None
117+
# html_title = None
119118

120119
# A shorter title for the navigation bar. Default is the same as html_title.
121-
#html_short_title = None
120+
# html_short_title = None
122121

123122
# The name of an image file (relative to this directory) to place at the top
124123
# of the sidebar.
125-
#html_logo = None
124+
# html_logo = None
126125

127126
# The name of an image file (within the static path) to use as favicon of the
128127
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
129128
# pixels large.
130-
#html_favicon = None
129+
# html_favicon = None
131130

132131
# Add any paths that contain custom static files (such as style sheets) here,
133132
# relative to this directory. They are copied after the builtin static files,
@@ -136,44 +135,44 @@
136135

137136
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
138137
# using the given strftime format.
139-
#html_last_updated_fmt = '%b %d, %Y'
138+
# html_last_updated_fmt = '%b %d, %Y'
140139

141140
# If true, SmartyPants will be used to convert quotes and dashes to
142141
# typographically correct entities.
143-
#html_use_smartypants = True
142+
# html_use_smartypants = True
144143

145144
# Custom sidebar templates, maps document names to template names.
146-
#html_sidebars = {}
145+
# html_sidebars = {}
147146

148147
# Additional templates that should be rendered to pages, maps page names to
149148
# template names.
150-
#html_additional_pages = {}
149+
# html_additional_pages = {}
151150

152151
# If false, no module index is generated.
153-
#html_domain_indices = True
152+
# html_domain_indices = True
154153

155154
# If false, no index is generated.
156-
#html_use_index = True
155+
# html_use_index = True
157156

158157
# If true, the index is split into individual pages for each letter.
159-
#html_split_index = False
158+
# html_split_index = False
160159

161160
# If true, links to the reST sources are added to the pages.
162-
#html_show_sourcelink = True
161+
# html_show_sourcelink = True
163162

164163
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
165-
#html_show_sphinx = True
164+
# html_show_sphinx = True
166165

167166
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
168-
#html_show_copyright = True
167+
# html_show_copyright = True
169168

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

175174
# This is the file name suffix for HTML files (e.g. ".xhtml").
176-
#html_file_suffix = None
175+
# html_file_suffix = None
177176

178177
# Output file base name for HTML help builder.
179178
htmlhelp_basename = 'pycodestyledoc'
@@ -183,13 +182,13 @@
183182

184183
latex_elements = {
185184
# The paper size ('letterpaper' or 'a4paper').
186-
#'papersize': 'letterpaper',
185+
# 'papersize': 'letterpaper',
187186

188187
# The font size ('10pt', '11pt' or '12pt').
189-
#'pointsize': '10pt',
188+
# 'pointsize': '10pt',
190189

191190
# Additional stuff for the LaTeX preamble.
192-
#'preamble': '',
191+
# 'preamble': '',
193192
}
194193

195194
# Grouping the document tree into LaTeX files. List of tuples
@@ -202,23 +201,23 @@
202201

203202
# The name of an image file (relative to this directory) to place at the top of
204203
# the title page.
205-
#latex_logo = None
204+
# latex_logo = None
206205

207206
# For "manual" documents, if this is true, then toplevel headings are parts,
208207
# not chapters.
209-
#latex_use_parts = False
208+
# latex_use_parts = False
210209

211210
# If true, show page references after internal links.
212-
#latex_show_pagerefs = False
211+
# latex_show_pagerefs = False
213212

214213
# If true, show URL addresses after external links.
215-
#latex_show_urls = False
214+
# latex_show_urls = False
216215

217216
# Documents to append as an appendix to all manuals.
218-
#latex_appendices = []
217+
# latex_appendices = []
219218

220219
# If false, no module index is generated.
221-
#latex_domain_indices = True
220+
# latex_domain_indices = True
222221

223222

224223
# -- Options for manual page output -------------------------------------------
@@ -231,7 +230,7 @@
231230
]
232231

233232
# If true, show URL addresses after external links.
234-
#man_show_urls = False
233+
# man_show_urls = False
235234

236235

237236
# -- Options for Texinfo output -----------------------------------------------
@@ -246,10 +245,10 @@
246245
]
247246

248247
# Documents to append as an appendix to all manuals.
249-
#texinfo_appendices = []
248+
# texinfo_appendices = []
250249

251250
# If false, no module index is generated.
252-
#texinfo_domain_indices = True
251+
# texinfo_domain_indices = True
253252

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

pycodestyle.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2626
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2727
# SOFTWARE.
28-
2928
r"""
3029
Check Python source code formatting, according to PEP 8.
3130
@@ -49,6 +48,7 @@
4948
"""
5049
from __future__ import with_statement
5150

51+
import bisect
5252
import inspect
5353
import keyword
5454
import os
@@ -57,7 +57,6 @@
5757
import time
5858
import tokenize
5959
import warnings
60-
import bisect
6160

6261
try:
6362
from functools import lru_cache

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
from __future__ import with_statement
32
from setuptools import setup
43

54

0 commit comments

Comments
 (0)