Skip to content

Commit a8b6573

Browse files
committed
Ensure flake8 is run on all Python files
This also fixes code style fixes in the Sphinx configuration file.
1 parent 7af50b7 commit a8b6573

3 files changed

Lines changed: 11 additions & 107 deletions

File tree

docs/conf.py

Lines changed: 6 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,18 @@
1111
# All configuration values have a default; values that are commented out
1212
# serve to show the default.
1313

14-
import sys, os
14+
"""python-stdnum documentation build configuration."""
1515

1616
import stdnum
1717

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

2319
# -- General configuration -----------------------------------------------------
2420

25-
# If your documentation needs a minimal Sphinx version, state it here.
26-
#needs_sphinx = '1.0'
27-
2821
# Add any Sphinx extension module names here, as strings. They can be extensions
2922
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
3023
extensions = [
31-
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
32-
'sphinx.ext.coverage', 'sphinx.ext.autosummary'
24+
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
25+
'sphinx.ext.coverage', 'sphinx.ext.autosummary',
3326
]
3427

3528
# Add any paths that contain templates here, relative to this directory.
@@ -46,7 +39,7 @@
4639

4740
# General information about the project.
4841
project = u'python-stdnum'
49-
copyright = u'2013-2019, Arthur de Jong'
42+
copyright = u'2013-2023, Arthur de Jong'
5043

5144
# The version info for the project you're documenting, acts as replacement for
5245
# |version| and |release|, also used in various other places throughout the
@@ -57,39 +50,15 @@
5750
# The full version, including alpha/beta/rc tags.
5851
release = version
5952

60-
# The language for content autogenerated by Sphinx. Refer to documentation
61-
# for a list of supported languages.
62-
#language = None
63-
64-
# There are two options for replacing |today|: either, you set today to some
65-
# non-false value, then it is used:
66-
#today = ''
67-
# Else, today_fmt is used as the format for a strftime call.
68-
#today_fmt = '%B %d, %Y'
69-
7053
# List of patterns, relative to source directory, that match files and
7154
# directories to ignore when looking for source files.
7255
exclude_patterns = ['_*', '.svn', '.git']
7356

74-
# The reST default role (used for this markup: `text`) to use for all documents.
75-
#default_role = None
76-
77-
# If true, '()' will be appended to :func: etc. cross-reference text.
78-
#add_function_parentheses = True
79-
80-
# If true, the current module name will be prepended to all description
81-
# unit titles (such as .. function::).
82-
#add_module_names = True
83-
84-
# If true, sectionauthor and moduleauthor directives will be shown in the
85-
# output. They are ignored by default.
86-
#show_authors = False
87-
8857
# The name of the Pygments (syntax highlighting) style to use.
8958
pygments_style = 'sphinx'
9059

9160
# A list of ignored prefixes for module index sorting.
92-
modindex_common_prefix = ['stdnum.', ]
61+
modindex_common_prefix = ['stdnum.']
9362

9463
# Automatically generate stub pages for autosummary entries.
9564
autosummary_generate = True
@@ -103,79 +72,13 @@
10372
# a list of builtin themes.
10473
html_theme = 'default'
10574

106-
# Theme options are theme-specific and customize the look and feel of a theme
107-
# further. For a list of options available for each theme, see the
108-
# documentation.
109-
#html_theme_options = {}
110-
111-
# Add any paths that contain custom themes here, relative to this directory.
112-
#html_theme_path = []
113-
114-
# The name for this set of Sphinx documents. If None, it defaults to
115-
# "<project> v<release> documentation".
116-
#html_title = None
117-
118-
# A shorter title for the navigation bar. Default is the same as html_title.
119-
#html_short_title = None
120-
121-
# The name of an image file (relative to this directory) to place at the top
122-
# of the sidebar.
123-
#html_logo = None
124-
125-
# The name of an image file (within the static path) to use as favicon of the
126-
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
127-
# pixels large.
128-
#html_favicon = None
129-
130-
# Add any paths that contain custom static files (such as style sheets) here,
131-
# relative to this directory. They are copied after the builtin static files,
132-
# so a file named "default.css" will overwrite the builtin "default.css".
133-
#html_static_path = ['_static']
134-
13575
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
13676
# using the given strftime format.
13777
html_last_updated_fmt = '%Y-%m-%d'
13878

139-
# If true, SmartyPants will be used to convert quotes and dashes to
140-
# typographically correct entities.
141-
#html_use_smartypants = True
142-
143-
# Custom sidebar templates, maps document names to template names.
144-
#html_sidebars = {}
145-
146-
# Additional templates that should be rendered to pages, maps page names to
147-
# template names.
148-
#html_additional_pages = {}
149-
150-
# If false, no module index is generated.
151-
#html_domain_indices = True
152-
153-
# If false, no index is generated.
154-
#html_use_index = True
155-
156-
# If true, the index is split into individual pages for each letter.
157-
#html_split_index = False
158-
15979
# If true, links to the reST sources are added to the pages.
16080
html_show_sourcelink = False
16181

162-
# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
163-
#html_show_sphinx = True
164-
165-
# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
166-
#html_show_copyright = True
167-
168-
# If true, an OpenSearch description file will be output, and all pages will
169-
# contain a <link> tag referring to it. The value of this option must be the
170-
# base URL from which the finished HTML is served.
171-
#html_use_opensearch = ''
172-
173-
# This is the file name suffix for HTML files (e.g. ".xhtml").
174-
#html_file_suffix = None
175-
176-
# Suffix for generated links to HTML files.
177-
#html_link_suffix = ''
178-
17982
# Output file base name for HTML help builder.
18083
htmlhelp_basename = 'python-stdnumdoc'
18184

@@ -186,10 +89,7 @@
18689
# (source start file, name, description, authors, manual section).
18790
man_pages = [
18891
('index', 'python-stdnum', u'python-stdnum Documentation',
189-
[u'Arthur de Jong'], 1)
92+
[u'Arthur de Jong'], 1),
19093
]
19194

192-
# If true, show URL addresses after external links.
193-
#man_show_urls = False
194-
19595
intersphinx_mapping = {'python': ('https://docs.python.org/3', None)}

setup.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ ignore =
3737
W504 # we put the binary operator on the preceding line
3838
max-complexity = 15
3939
max-line-length = 120
40+
extend-exclude =
41+
.github
42+
.pytest_cache
43+
build
4044

4145
[isort]
4246
lines_after_imports = 2

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ deps = flake8<6.0
2828
flake8-tidy-imports
2929
flake8-tuple
3030
pep8-naming
31-
commands = flake8 stdnum tests update setup.py online_check/stdnum.wsgi
31+
commands = flake8 .
3232

3333
[testenv:docs]
3434
use_develop = true

0 commit comments

Comments
 (0)