Skip to content

Commit

Permalink
Do 'noqa' file check right after lint start
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir Rudnyh committed Aug 18, 2013
1 parent c1b8d2a commit 2051dc5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
8 changes: 6 additions & 2 deletions Flake8Lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
import sublime_plugin

try:
from .lint import lint, lint_external
from .lint import lint, lint_external, skip_file
except ValueError:
from lint import lint, lint_external # noqa
from lint import lint, lint_external, skip_file # noqa


settings = None
Expand Down Expand Up @@ -90,6 +90,10 @@ def run(self, edit):
if not self.view.match_selector(0, 'source.python'):
return

# skip file check if 'noqa' for whole file is set
if skip_file(filename):
return

# we need to always clear regions. three situations here:
# - we need to clear regions with fixed previous errors
# - is user will turn off 'highlight' in settings and then run lint
Expand Down
8 changes: 0 additions & 8 deletions lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,6 @@ def lint(filename, settings):
if not filename or not os.path.exists(filename):
return

# skip file check if 'noqa' for whole file is set
if skip_file(filename):
return

# place for warnings =)
warnings = []

Expand Down Expand Up @@ -159,10 +155,6 @@ def lint_external(filename, settings, interpreter, linter):
if not filename or not os.path.exists(filename):
return

# skip file check if 'noqa' for whole file is set
if skip_file(filename):
return

# first argument is interpreter
arguments = [interpreter, linter]

Expand Down

0 comments on commit 2051dc5

Please sign in to comment.