Previously, we forced Flake8 to be installed in whatever Python
environment that the user was using. This allows someone to use Flake8
from a virtual environment, e.g., if you use the tox.ini from this
commit, you can do:
tox -e venv -- flake8 --install-hook git
And that will allow you to use the Python and Flake8 from
./.tox/venv/bin/python. This means that you can avoid installing
Flake8 globally and still have a working commit hook.
If we create our temporary directory structure for our files, we need
to ensure that all the directories (including the ones in the filename)
exist before we copy the contents to that location.
flake8.main.git.install was already returning False if it couldn't
find the directory to install into. This makes mercurial.install do
the same thing and allows the vcs.install callback to understand that.
Also add the --install-hook option and plumb it's installation through
flake8.main.vcs's function that understands how to install the desired
VCS integration bits.
Finally, we also mock out the mercurial integration.
Certain versions of Python on Windows are capable of using
multiprocessing safely and correctly. Instead of completely disabling
multiprocessing on Windows, this allows us to check for safe versions.
This also updates our internal utility documentation to add missing
functions and add a strongly worded warning about the API of those
functions.
This adds E501 which is actually a poor test. Currently,
pep8.maximum_line_length does its own check for noqa instead of relying
on the Checker. See also: https://github.com/PyCQA/pycodestyle/pull/539
To make sure we reduce as much duplication as possible, we parse the
diff output in our main command-line Application. That then takes
responsibility for telling the StyleGuide about the line numbers that
are in the diff as well as telling the file checker manager which files
from the diff should be checked.
This will read stdin using utils.stdin_get_value and parse it into
a dictionary similar to pep8/pycodestyle's parse_udiff function.
This differs from that function in the order in which it parses the
diff and also in that it does not try to filter the paths in the diff.
It lets a different level take care of that for it.
This will likely be used to send paths to the FileCheckerManager and
also send the ranges to the StyleGuide so it can filter errors not in
those ranges.