Once again, not much different to the previous conversions. We make best
use of the argparse module, allowing us to remove some funky
workarounds.
Signed-off-by: Stephen Finucane <stephen@that.guru>
For the same reasons as the 'sphinx-apidoc' and 'sphinx-autogen' moves.
As before, we also take the opportunity to add a help string.
Signed-off-by: Stephen Finucane <stephen@that.guru>
For the same reasons as the 'sphinx-apidoc' move. We also take the
opportunity to add a help string and epilog while we're at it.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Another mostly trivial conversion. The only odd thing here is that we
add a '--version' parameter to keep things in line with the other
applications.
Signed-off-by: Stephen Finucane <stephen@that.guru>
This lets us better reason about what the parser is doing and use tools
like 'sphinx-contrib.autoprogram' in our own documentation in the
future.
Signed-off-by: Stephen Finucane <stephen@that.guru>
This is pretty self-explanatory, with most changes coming about as a
side-effect of argparse vs. optparse API differences.
Lowercase characters are used in help strings, per argparse conventions.
Some tests are converted because argparse natively supports unicode.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Executable scripts without the '.py' extension are already created and
installed by setuptools, by way of the 'console_scripts' section. These
scripts are unnecessary noise. If people want to test this behavior
locally, use a virtualenv.
Signed-off-by: Stephen Finucane <stephen@that.guru>
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.