mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-07 21:44:18 +00:00
apply pep8.py changes as per previous version
This commit is contained in:
parent
a5d203440a
commit
3035b04dce
1 changed files with 8 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
|
# flake8: noqa
|
||||||
# pep8.py - Check Python source code formatting, according to PEP 8
|
# pep8.py - Check Python source code formatting, according to PEP 8
|
||||||
# Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net>
|
# Copyright (C) 2006 Johann C. Rocholl <johann@rocholl.net>
|
||||||
#
|
#
|
||||||
|
|
@ -108,6 +109,7 @@ try:
|
||||||
except NameError:
|
except NameError:
|
||||||
from sets import ImmutableSet as frozenset
|
from sets import ImmutableSet as frozenset
|
||||||
|
|
||||||
|
from flake8.util import skip_line
|
||||||
|
|
||||||
DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git'
|
DEFAULT_EXCLUDE = '.svn,CVS,.bzr,.hg,.git'
|
||||||
DEFAULT_IGNORE = 'E24'
|
DEFAULT_IGNORE = 'E24'
|
||||||
|
|
@ -992,6 +994,8 @@ class Checker(object):
|
||||||
"""
|
"""
|
||||||
Report an error, according to options.
|
Report an error, according to options.
|
||||||
"""
|
"""
|
||||||
|
if skip_line(self.physical_line):
|
||||||
|
return
|
||||||
code = text[:4]
|
code = text[:4]
|
||||||
if ignore_code(code):
|
if ignore_code(code):
|
||||||
return
|
return
|
||||||
|
|
@ -1006,7 +1010,7 @@ class Checker(object):
|
||||||
# Don't care about expected errors or warnings
|
# Don't care about expected errors or warnings
|
||||||
return
|
return
|
||||||
self.file_errors += 1
|
self.file_errors += 1
|
||||||
if options.counters[code] == 1 or options.repeat:
|
if options.counters[code] == 1 or not options.no_repeat:
|
||||||
message("%s:%s:%d: %s" %
|
message("%s:%s:%d: %s" %
|
||||||
(self.filename, self.line_offset + line_number,
|
(self.filename, self.line_offset + line_number,
|
||||||
offset + 1, text))
|
offset + 1, text))
|
||||||
|
|
@ -1025,6 +1029,7 @@ def input_file(filename):
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
message('checking ' + filename)
|
message('checking ' + filename)
|
||||||
errors = Checker(filename).check_all()
|
errors = Checker(filename).check_all()
|
||||||
|
return errors
|
||||||
|
|
||||||
|
|
||||||
def input_dir(dirname, runner=None):
|
def input_dir(dirname, runner=None):
|
||||||
|
|
@ -1261,8 +1266,8 @@ def process_options(arglist=None):
|
||||||
help="print status messages, or debug with -vv")
|
help="print status messages, or debug with -vv")
|
||||||
parser.add_option('-q', '--quiet', default=0, action='count',
|
parser.add_option('-q', '--quiet', default=0, action='count',
|
||||||
help="report only file names, or nothing with -qq")
|
help="report only file names, or nothing with -qq")
|
||||||
parser.add_option('-r', '--repeat', action='store_true',
|
parser.add_option('-r', '--no-repeat', action='store_true',
|
||||||
help="show all occurrences of the same error")
|
help="don't show all occurrences of the same error")
|
||||||
parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE,
|
parser.add_option('--exclude', metavar='patterns', default=DEFAULT_EXCLUDE,
|
||||||
help="exclude files or directories which match these "
|
help="exclude files or directories which match these "
|
||||||
"comma separated patterns (default: %s)" %
|
"comma separated patterns (default: %s)" %
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue