Skip to content

Commit e57b1f1

Browse files
committed
Read pep8 conf. files from parent directories.
Fixed bug where pep8 configuration file was only read on the current directory, instead of searching also parent directories. Related to issue #3.
1 parent f44f8a2 commit e57b1f1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

linter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ def check(self, code, filename):
6262
# `onError` will be called by `process_options` when no pep8 configuration file is found.
6363
# Override needed to supress OptionParser.error() output in the default parser.
6464
def onError(msg):
65-
raise SystemExit
65+
pass
6666

6767
from pep8 import process_options, get_parser
6868
parser = get_parser()
6969
parser.error = onError
70-
pep8_options, _ = process_options([], True, True, parser=parser)
70+
pep8_options, _ = process_options([os.curdir], True, True, parser=parser)
7171
pep8_options = vars(pep8_options)
72-
del pep8_options['reporter']
72+
pep8_options.pop('reporter', None)
7373
for opt_n, opt_v in pep8_options.items():
7474
if isinstance(final_options.get(opt_n, None), list):
7575
final_options[opt_n] += opt_v

0 commit comments

Comments
 (0)