| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
| |
This is an emerging best practice and there is little reason to not
follow it
|
| |
|
|
| |
Add a version info tuple for plugins to use
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
This relies on two things:
1. Properly configuring flake8-import-order to use that style
2. Properly configuring flake8-import-order to know that flake8 is our
application name.
|
| |
|
|
|
|
|
|
|
|
|
| |
ConfigFileFinder should absolutely handle broken/invalid config files
by refusing to try to parse them. Here we catch the ParsingError,
log the exception, and then return normally. The RawConfigParser
instance is perfectly valid still and will behave as if nothing had
been read and we just need to indicate that we didn't find any files
worthy of reading.
Related to: https://github.com/PyCQA/pycodestyle/issues/506
|
| |
|
|
|
|
|
|
| |
This proved simpler because I realized something important: Most of the
code that the old integration was using was in fact doing nothing of
value. Since we can't meaningfully allow users to use command-line
options as parameters to `python setup.py flake8`, we just remove the
work that we do to set up those attributes and parse them.
|
| |
|
|
|
| |
This allows us to add --append-to-select and --append-to-ignore at a
later date that will work as expected and in a consistent manner.
|
| |
|
|
|
| |
Extract the files changed in a particular commit or set of commits
for the commit and qrefresh mercurial hooks.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
subprocess.Popen#communicate returns (stdout, stdin) but we were only
unpacking stdout from it causing an exception.
|
| |
|
|
|
| |
Previously we were using stat.IROTH instead of stat.S_IROTH. I must
have been thinking about retirement. ;-)
|
| |
|
|
|
| |
If we restrict the user's ability to specify a format string, we break
existing workflows.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
| |
This also reports errors with hook installation using exceptions and
includes far more exceptions for mercurial since it has more failure
modes.
|
| | |
|
| |
|
|
| |
The stdlib module is tempfile not tempdir ;-)
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| | |
|
| |
|
|
| |
Stub out the primary method people seem to use.
|
| | |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
If we don't check for a file's existence, then we'll find ourselves with
a hung subprocess due to an exception that happens with in it.
|
| | |
|
| |
|
|
|
| |
This allows us to properly exit if no errors were reported (due to,
for example, # noqa).
|
| |
|
|
|
| |
We could probably use non-git diff fixtures, but those are what we have
for now.
|
| | |
|
| | |
|
| |
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When normalizing paths in flake8.utils, we use the os.path.sep constant
to determine if the item is intended to be a path. If Windows users then
have a path like
foo\bar
Specified, they will get the same behaviour as a *nix user with
foo/bar
|
| | |
|
| |
|
|
|
|
|
|
| |
This allows us to handle --show-source in our formatters by default.
This also adds the physical line information to the Error class instead
of passing it to is_inline_ignored. This allows us to avoid using
linecache in our formatters.
|
| |
|
|
|
|
| |
Python 2.7's ConfigParser module does not allow for the behaviour we
have documented for config files in Flake8 3.0. To compensate for that,
we add a dependency on the configparser backport on PyPI for Python 2.7
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
We move the logic to add or remove a plugin from the default ignore
list to individual methods on the Plugin class (Plugin#enable,
Plugin#disable) and use that when registering and parsing options.
If the plugin is off-by-default, Plugin#register_options will use
Plugin#disable. When parsing options via Plugin#provide_options, if
the plugin has been specified in --enable-extensions then it will be
re-enabled via Plugin#enable.
|
| | |
|
| | |
|
| |
|
|
|
| |
If a plugin is off-by-default use its entry-point name (as we currently
do in flake8 2.x) to add it to the default ignore list.
|
| |
|
|
| |
Explain why we remove --version, --help, and -h
|
| | |
|
| |
|
|
|
|
|
| |
Since we now treat pep8 checks each as an individual plugin, we need a way to
represent pep8 as a single plugin in the version output (like we currently
do). As such we need to be a bit wiser in how we tell the OptionManager about
plugins and their versions and we only do this for certain plugins.
|
| | |
|
| | |
|
| | |
|
| | |
|