When we read in a file on Python 3, we use the tokenize module to detect
the coding pragma at the top of the file. We then use that to decode the
rest of the file. However, when we were receiving stdin, we would not do
that.
This updates ``stdin_get_value`` in a backwards compatible way to check
for that coding pragma and then fall back to UTF-8 if necessary.
Closes#306
Apparently there are some cases where the git hook will not find files
to run the checks against (e.g., when amending a commit message). In
those cases, it's best not to attempt to run any checks and to allow the
hook to exit successfully.
Closes#303
When we receive a SyntaxError, it is not guaranteed to have a token that
includes the physical line causing the issue. If it does not, we now
will avoid trying to determine the number of rows and columns that are
actually there and default to what the error tells us.
Closes#279
In our setuptools integration command, we were attempting to avoid
checking each submodule in the packages list. This was done without
recognizing that two modules may start with the same prefix, e.g.,
- foo
- foo_bar
- foo_biz
In this case, we only ever checked ``foo``. By appending a '.' to the
end of each package name, we avoid this since we only care about
deduplicating submodules, e.g.,
- foo
- foo.sub
- foo.sub.sub
Closes#295
By ordering the plugins, --version becomes reproducible so that it
continuously prints the same output (provided the plugins have not
changed).
Closes#297
PyLint does not yet support 3.6 [1] and the dogfood environment really
shouldn't be pinning to a specific version of Python 3.
[1]: https://github.com/PyCQA/pylint/issues/1241
Display the local paths from the git hook
Instead of displaying the path to the temporary directory, as we always
have, it's been requested that we instead display the path to the file
that was copied to the temporary directory.
Closes#244
See merge request !154
Instead of displaying the path to the temporary directory, as we always
have, it's been requested that we instead display the path to the file
that was copied to the temporary directory.
Closes#244
Enable users who want to track all files processed
This adds two new methods to the BaseFormatter class:
- beginning
- finished
These will indicate when Flake8 begins and finishes processing a file.
Closes#251
See merge request !152
This adds two new methods to the BaseFormatter class:
- beginning
- finished
These will indicate when Flake8 begins and finishes processing a file.
Closes#251
Assign missing codes to PyFlakes messages
Some PyFlakes messages weren't covered by unique messages, making them
impossible to select/ignore. This is now fixed.
To ensure we don't regress in the future, a test has been added that fails if
there's any uncovered messages.
See merge request !159
Some PyFlakes messages weren't covered by unique messages, making them
impossible to select/ignore. This is now fixed.
To ensure we don't regress in the future, a test has been added that fails if
there's any uncovered messages.
Only force files to be included when run from CLI
Previously we added support so users can do:
$ flake8 bin/executable
But this broke the fact that git hooks shouldn't check things like
reStructuredText doc files. This commit restores that functionality but
will cause bin/executable to be ignored in the git hook. This seems fair
since folks can amend their filename patterns to include it explicitly.
Closes#268
See merge request !157
Previously we added support so users can do:
$ flake8 bin/executable
But this broke the fact that git hooks shouldn't check things like
reStructuredText doc files. This commit restores that functionality but
will cause bin/executable to be ignored in the git hook. This seems fair
since folks can amend their filename patterns to include it explicitly.
Closes#268