Permalink
Browse files

Reverted fix for #368 which had unintended repurcussions in flake8 an…

…d 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
  • Loading branch information...
IanLee1521 committed Mar 18, 2015
1 parent f6fe8ac commit 435d1cbf995a659a82d1d4b42d25e3459556ef21
Showing with 20 additions and 14 deletions.
  1. +6 −0 CHANGES.txt
  2. +14 −14 pep8.py
@@ -5,6 +5,12 @@ Changelog
1.6.x (unreleased)
------------------

Changes:

* Reverted the fix in #368, "options passed on command line are only ones
accepted" feature. This has many unintended consequences in pep8 and flake8
and needs to be reworked when I have more time.

1.6.2 (2015-02-15)
------------------

28 pep8.py
@@ -1984,24 +1984,24 @@ def read_config(options, args, arglist, parser):

local_dir = os.curdir

if USER_CONFIG and os.path.isfile(USER_CONFIG):
if options.verbose:
print('user configuration: %s' % USER_CONFIG)
config.read(USER_CONFIG)

parent = tail = args and os.path.abspath(os.path.commonprefix(args))
while tail:
if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
local_dir = parent
if options.verbose:
print('local configuration: in %s' % parent)
break
(parent, tail) = os.path.split(parent)

if cli_conf and os.path.isfile(cli_conf):
if options.verbose:
print('cli configuration: %s' % cli_conf)
config.read(cli_conf)
else:
if USER_CONFIG and os.path.isfile(USER_CONFIG):
if options.verbose:
print('user configuration: %s' % USER_CONFIG)
config.read(USER_CONFIG)

parent = tail = args and os.path.abspath(os.path.commonprefix(args))
while tail:
if config.read(os.path.join(parent, fn) for fn in PROJECT_CONFIG):
local_dir = parent
if options.verbose:
print('local configuration: in %s' % parent)
break
(parent, tail) = os.path.split(parent)

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

2 comments on commit 435d1cb

@petrrr

This comment has been minimized.

Copy link

petrrr replied Jun 29, 2015

I am just wondering, if this commit could not be formally released. Looking at the commit history I do not see any other relevant changes, which would cause problems. This would help to get the pep8 vs. flake8 incompatibility resolved. Thanks for considering this.

@petrrr

This comment has been minimized.

Copy link

petrrr replied Jun 29, 2015

I forgot to mention, this would also help to solve the following Macport issue: https://trac.macports.org/ticket/47429, without further fuzz ...

Please sign in to comment.