Skip to content

Commit 435d1cb

Browse files
committed
Reverted fix for #368 which had unintended repurcussions in flake8 and other places.
This fix reverts to the parsing of user config (~/.config/pep8), then local directory config files, and finally overrides with cli options as was the behavior back in 1.5.7
1 parent f6fe8ac commit 435d1cb

File tree

2 files changed

+20
-14
lines changed

2 files changed

+20
-14
lines changed

CHANGES.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Changelog
55
1.6.x (unreleased)
66
------------------
77

8+
Changes:
9+
10+
* Reverted the fix in #368, "options passed on command line are only ones
11+
accepted" feature. This has many unintended consequences in pep8 and flake8
12+
and needs to be reworked when I have more time.
13+
814
1.6.2 (2015-02-15)
915
------------------
1016

pep8.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1984,24 +1984,24 @@ def read_config(options, args, arglist, parser):
19841984

19851985
local_dir = os.curdir
19861986

1987+
if USER_CONFIG and os.path.isfile(USER_CONFIG):
1988+
if options.verbose:
1989+
print('user configuration: %s' % USER_CONFIG)
1990+
config.read(USER_CONFIG)
1991+
1992+
parent = tail = args and os.path.abspath(os.path.commonprefix(args))
1993+
while tail:
1994+
if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
1995+
local_dir = parent
1996+
if options.verbose:
1997+
print('local configuration: in %s' % parent)
1998+
break
1999+
(parent, tail) = os.path.split(parent)
2000+
19872001
if cli_conf and os.path.isfile(cli_conf):
19882002
if options.verbose:
19892003
print('cli configuration: %s' % cli_conf)
19902004
config.read(cli_conf)
1991-
else:
1992-
if USER_CONFIG and os.path.isfile(USER_CONFIG):
1993-
if options.verbose:
1994-
print('user configuration: %s' % USER_CONFIG)
1995-
config.read(USER_CONFIG)
1996-
1997-
parent = tail = args and os.path.abspath(os.path.commonprefix(args))
1998-
while tail:
1999-
if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
2000-
local_dir = parent
2001-
if options.verbose:
2002-
print('local configuration: in %s' % parent)
2003-
break
2004-
(parent, tail) = os.path.split(parent)
20052005

20062006
pep8_section = parser.prog
20072007
if config.has_section(pep8_section):

0 commit comments

Comments
 (0)