summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosef Skladanka <jskladan@redhat.com>2017-08-08 06:27:54 +0200
committerJosef Skladanka <jskladan@redhat.com>2017-08-08 06:27:54 +0200
commitbf25fef7eb5eedd2d197a3a3b0ff1d523488a3b1 (patch)
tree3ae6d036551fc9aa1151e9f4ba8ead824923719b
parentcead98598ac5503837d491da2adc380f19bc33da (diff)
downloadflake8-bf25fef7eb5eedd2d197a3a3b0ff1d523488a3b1.tar.gz
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
-rw-r--r--src/flake8/checker.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/flake8/checker.py b/src/flake8/checker.py
index 569eafa..6e53cb5 100644
--- a/src/flake8/checker.py
+++ b/src/flake8/checker.py
@@ -209,6 +209,7 @@ class Manager(object):
filename_patterns = self.options.filename
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
# best solution right now.
@@ -227,6 +228,7 @@ class Manager(object):
# If it was specified explicitly, the user intended for it to be
# checked.
explicitly_provided = (not running_from_vcs and
+ not running_from_diff and
(argument == filename))
return ((file_exists and
(explicitly_provided or matches_filename_patterns)) or