Skip to content

Commit

Permalink
Trac #34617: fix and activate pycodestyle W391
Browse files Browse the repository at this point in the history
URL: https://trac.sagemath.org/34617
Reported by: chapoton
Ticket author(s): Frédéric Chapoton
Reviewer(s): Matthias Koeppe
  • Loading branch information
Release Manager committed Oct 11, 2022
2 parents 7563675 + fba8e59 commit 33a0f7a
Show file tree
Hide file tree
Showing 16 changed files with 11 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"python.linting.enabled": true,
// The following pycodestyle arguments are the same as the pycodestyle-minimal
// tox environnment, see the file SAGE_ROOT/src/tox.ini
"python.linting.pycodestyleArgs": ["--select=E111,E306,E401,E701,E702,E703,W605,E711,E712,E713,E721,E722"],
"python.linting.pycodestyleArgs": ["--select=E111,E306,E401,E701,E702,E703,W391,W605,E711,E712,E713,E721,E722"],
"cSpell.words": [
"furo",
"Conda",
Expand Down
5 changes: 2 additions & 3 deletions src/doc/de/thematische_anleitungen/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,14 @@

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

# Output file base name for HTML help builder.
htmlhelp_basename = name

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', name+'.tex', project,
('index', name + '.tex', project,
'The Sage Group', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/de/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@
('index', name+'.tex', project,
'The Sage Group', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,3 @@
('index', 'a_tour_of_sage.tex', 'A Tour Of Sage',
'The Sage Development Team', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/constructions/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
('index', 'constructions.tex', 'Constructions',
'The Sage Development Team', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/developer/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
('index', 'developer.tex', 'Developer\'s Guide',
'The Sage Development Team', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/installation/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
('index', 'installation.tex', 'Installation Guide',
'The Sage Development Team', 'manual'),
]

Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@
('index', name + '.tex', 'Three Lectures about Explicit Methods in\nNumber Theory Using Sage',
'William Stein', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/thematic_tutorials/numerical_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@
('index', name + '.tex', 'Numerical Computing with Sage',
'The Sage Development Team', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@
('index', 'sage_tutorial.tex', 'Tutorial',
'The Sage Development Team', 'manual'),
]

1 change: 0 additions & 1 deletion src/doc/en/website/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,3 @@
html_additional_pages = {
'index': 'index_furo.html' if html_theme == 'furo' else 'index.html',
}

1 change: 0 additions & 1 deletion src/doc/fr/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,3 @@
# the definition of \\at in the standard preamble of the sphinx doc
# conflicts with that in babel/french[b]
latex_elements['preamble'] += '\\let\\at\\undefined'

1 change: 0 additions & 1 deletion src/doc/ru/tutorial/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,3 @@

# Additional LaTeX stuff if necessary:
#latex_elements['preamble'] += '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}\n'

3 changes: 1 addition & 2 deletions src/doc/tr/a_tour_of_sage/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, document class [howto/manual]).
latex_documents = [
('index', name+'.tex', 'Sage Turu',
('index', name + '.tex', 'Sage Turu',
'The Sage Development Team', 'manual'),
]

7 changes: 5 additions & 2 deletions src/sage_docbuild/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def sphinx_plot(graphics, **kwds):
# Cross-links to other project's online documentation.
python_version = sys.version_info.major


def set_intersphinx_mappings(app, config):
"""
Add precompiled inventory (the objects.inv)
Expand All @@ -207,7 +208,7 @@ def set_intersphinx_mappings(app, config):
app.config.intersphinx_mapping = {}
return

app.config.intersphinx_mapping = {
app.config.intersphinx_mapping = {
'python': ('https://docs.python.org/',
os.path.join(SAGE_DOC_SRC, "common",
"python{}.inv".format(python_version))),
Expand All @@ -232,6 +233,7 @@ def set_intersphinx_mappings(app, config):

intersphinx.normalize_intersphinx_mapping(app, config)


# By default document are not master.
multidocs_is_master = True

Expand Down Expand Up @@ -819,6 +821,7 @@ def nitpick_patch_config(app):
'__builtin__',
]


def check_nested_class_picklability(app, what, name, obj, skip, options):
"""
Print a warning if pickling is broken for nested classes.
Expand Down Expand Up @@ -878,6 +881,7 @@ class will be properly documented inside its surrounding class.

return skip


# This replaces the setup() in sage.misc.sagedoc_conf
def setup(app):
app.connect('autodoc-process-docstring', process_docstring_cython)
Expand All @@ -904,4 +908,3 @@ def setup(app):
app.connect('missing-reference', find_sage_dangling_links)
app.connect('builder-inited', nitpick_patch_config)
app.connect('html-page-context', add_page_context)

3 changes: 2 additions & 1 deletion src/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,11 @@ description =
# E713 test for membership should be 'not in'
# E721: do not compare types, use isinstance()
# E722: do not use bare except, specify exception instead
# W391: blank line at end of file
# W605: invalid escape sequence ‘x’
# See https://pycodestyle.pycqa.org/en/latest/intro.html#error-codes
deps = pycodestyle
commands = pycodestyle --select E111,E306,E401,E701,E702,E703,W605,E711,E712,E713,E721,E722 {posargs:{toxinidir}/sage/}
commands = pycodestyle --select E111,E306,E401,E701,E702,E703,W391,W605,E711,E712,E713,E721,E722 {posargs:{toxinidir}/sage/}
pycodestyle --select E111,E401,E703,E712,E713,E721,E722 --filename *.pyx {posargs:{toxinidir}/sage/}
[pycodestyle]
Expand Down

0 comments on commit 33a0f7a

Please sign in to comment.