mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix flake8 violations
This commit is contained in:
parent
052f24face
commit
2bdbe3aaf4
@ -31,7 +31,7 @@ directory = sphinx/locale/
|
||||
|
||||
[flake8]
|
||||
max-line-length = 95
|
||||
ignore = E116,E241,E251,E741,I101
|
||||
ignore = E116,E241,E251,E741,W504,I101
|
||||
exclude = .git,.tox,.venv,tests/*,build/*,doc/_build/*,sphinx/search/*,doc/ext/example*.py
|
||||
application-import-names = sphinx
|
||||
import-order-style = smarkets
|
||||
|
@ -158,7 +158,7 @@ class CheckExternalLinksBuilder(Builder):
|
||||
# the server and the network
|
||||
response = requests.head(req_url, config=self.app.config, **kwargs)
|
||||
response.raise_for_status()
|
||||
except HTTPError as err:
|
||||
except HTTPError:
|
||||
# retry with GET request if that fails, some servers
|
||||
# don't like HEAD requests.
|
||||
response = requests.get(req_url, stream=True, config=self.app.config,
|
||||
|
@ -29,7 +29,7 @@ if False:
|
||||
from sphinx.application import Sphinx # NOQA
|
||||
|
||||
|
||||
glob_re = re.compile('.*[*?\[].*')
|
||||
glob_re = re.compile(r'.*[*?\[].*')
|
||||
|
||||
|
||||
def int_or_nothing(argument):
|
||||
|
@ -263,7 +263,7 @@ def find_autosummary_in_docstring(name, module=None, filename=None):
|
||||
pass
|
||||
except ImportError as e:
|
||||
print("Failed to import '%s': %s" % (name, e))
|
||||
except SystemExit as e:
|
||||
except SystemExit:
|
||||
print("Failed to import '%s'; the module executes module level "
|
||||
"statement and it might call sys.exit()." % name)
|
||||
return []
|
||||
|
@ -235,7 +235,7 @@ class ExtBabel(Babel):
|
||||
|
||||
def get_mainlanguage_options(self):
|
||||
# type: () -> unicode
|
||||
"""Return options for polyglossia's ``\setmainlanguage``."""
|
||||
"""Return options for polyglossia's ``\\setmainlanguage``."""
|
||||
language = super(ExtBabel, self).get_language()
|
||||
if self.use_polyglossia is False:
|
||||
return None
|
||||
|
Loading…
Reference in New Issue
Block a user