mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-11 15:24:18 +00:00
Lint only *.py files with --diff option
When using the `--diff` option flake8 only lints *.py files or files defined by the `--filename` filter. Fixes #362
This commit is contained in:
parent
cead98598a
commit
bf25fef7eb
1 changed files with 2 additions and 0 deletions
|
|
@ -209,6 +209,7 @@ class Manager(object):
|
||||||
|
|
||||||
filename_patterns = self.options.filename
|
filename_patterns = self.options.filename
|
||||||
running_from_vcs = self.options._running_from_vcs
|
running_from_vcs = self.options._running_from_vcs
|
||||||
|
running_from_diff = self.options.diff
|
||||||
|
|
||||||
# NOTE(sigmavirus24): Yes this is a little unsightly, but it's our
|
# NOTE(sigmavirus24): Yes this is a little unsightly, but it's our
|
||||||
# best solution right now.
|
# best solution right now.
|
||||||
|
|
@ -227,6 +228,7 @@ class Manager(object):
|
||||||
# If it was specified explicitly, the user intended for it to be
|
# If it was specified explicitly, the user intended for it to be
|
||||||
# checked.
|
# checked.
|
||||||
explicitly_provided = (not running_from_vcs and
|
explicitly_provided = (not running_from_vcs and
|
||||||
|
not running_from_diff and
|
||||||
(argument == filename))
|
(argument == filename))
|
||||||
return ((file_exists and
|
return ((file_exists and
|
||||||
(explicitly_provided or matches_filename_patterns)) or
|
(explicitly_provided or matches_filename_patterns)) or
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue