There are still a couple of checks here but all of them can be removed
now:
- Check if using valid Python syntax
- Check if line length too long
- Check if using 'x == None/True/False'
- Check if using old HTML 3 tags
The first three are already handled by default by the 'flake8' tool. The
last one isn't replaced by anything, but it really isn't worth worrying
about now because the tags it checks for have been dead for a really
long time and would not be used by anyone writing HTML in the last 10
years. Combined, it means we can remove the entire file.
The 'style-check' target is updated to simply alias 'flake8'. It can be
removed in a future release. This allows us to stop using this target in
the Travis jobs, seeing as we already run flake8.
Signed-off-by: Stephen Finucane <stephen@that.guru>
If we want to check style, we run 'tox -e flake8': it shouldn't be
necessary to run some obscure 'make' command too. Make this possible by
moving the sole useful test from the target of this make command to a
flake8 plugin.
This includes a fix for a header that was previously excluded from
checks, but is now included.
Signed-off-by: Stephen Finucane <stephen@that.guru>
We're going to be doing some surgery on this function, so first clean it
up before we do anything else.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Nobody seems to be using this, probably because of the 'flake8' target,
and it hasn't been touched, some Python/flake8 updates aside in years.
Just remove it.
The Make target is not removed to both give us time to warn users that
the target is gone and, more importantly, to prevent merge conflicts
with other patches being submitted at the same time.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Two default-disabled options are enabled:
- show_column_numbers - Shows context notes before errors
- show_error_context - Shows column numbers in error messages
This should make the output of mypy a little easier to parse.
Signed-off-by: Stephen Finucane <stephen@that.guru>
As I've previously discovered [1], this doesn't actually do anything in
modern tox. Simply remove it.
[1] https://review.openstack.org/#/c/369986/
Signed-off-by: Stephen Finucane <stephen@that.guru>
Turns out this requires Python 3.2 at a minimum. Who knew? We don't
support Python 3.1 so simply fix to 'python3'.
Signed-off-by: Stephen Finucane <stephen@that.guru>
There is value in examining coverage for something like Sphinx. Start
doing this by default, in anticipation of increasing coverage over time.
Signed-off-by: Stephen Finucane <stephen@that.guru>
This isn't enabled by default because it throws so many damn errors.
Perhaps we should simply remove this?
Signed-off-by: Stephen Finucane <stephen@that.guru>
There are still plenty of projects which use custom templates where
DOCUMENTATION_OPTIONS does not define SOURCELINK_SUFFIX.
Currently search does not work in these projects. Make suffix fall
back to .txt since that is the default value of configuration option.
We're going to move the executable's here (or at least those that part
of the core library). The 'sphinx-build' executable was already moved,
so lets do 'sphinx-quickstart' next.
To avoid breaking packages that are using this feature directly, aliases
for the old 'main' method are included. This is based on what Django
does [1] and, like Django, will allow us to safely remove the old
modules in Sphinx 2.0.
[1] https://github.com/django/django/blob/1.11/django/test/runner.py#L688-L695
Signed-off-by: Stephen Finucane <stephen@that.guru>
We have multiple executables in tree and, while 'sphinx-build' is
arguably the most important of these, there's no reason its importance
should warrant inclusion at the package level.
Create a new module, 'sphinx.cmd', and move the code from
'sphinx.__init__' into a 'build' submodule within. This name might be a
bit disingenuous at present, given the availability of 'make-mode' here
too, but that's an artifact of the current executable design and can be
cleaned up later.
To avoid breaking packages that are using this feature directly, aliases
for the old 'main' method are included. This is based on what Django
does [1] and, like Django, will allow us to safely remove the old
modules in Sphinx 2.0.
[1] https://github.com/django/django/blob/1.11/django/test/runner.py#L688-L695
Signed-off-by: Stephen Finucane <stephen@that.guru>
There were a number of package error handlers run as part of the
'sphinx-build' command/executable:
- Unsupported Python version (it should be 2.7 or 3.4+)
- Missing packages (missing docutils, jinja2, and roman, which is part
of docutils, packages)
- Out-of-date packages (docutils)
This code is mostly unchanged since Sphinx was first released. Python,
and in particular Python's packaging options, have come a long way since
then. Today, all of the above checks are provided by setuptools and the
'setup.py' script, meaning we should never actually get to the point of
triggering any of these checks. This is further reinforced by the fact
that none of the other executables carry out these checks: either this
is a bug that no one has reported in ~8 years or, more likely, the
checks are useless and we don't need them anywhere.
In all, we can happily remove these checks, greatly simplify a piece of
code that's otherwise rarely touched, and trust that setuptools is up to
the job it's designed for.
Signed-off-by: Stephen Finucane <stephen@that.guru>