-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
defined config overwritten by config further up directory tree #368
Comments
Remove the default of ~/.config/pep8, and instead parse that explictly. If a command line option is passed using --config, then it is the only config handled.
Closed with commit 19d9a82 |
It seems like the fix for this issue essentially broke people relying on config files in |
I've got to leave for the weekend but I wanted to include what I've found so far:
My python code: My config:
Run it:
That's goodish news. In the process I ran across the fact that the .config/pep8 file is read when flake8 is run but the [flake8] section is used. When pep8 is run the .config/pep8 file is read but the [pep8] section is used. I haven't looked into why flake8 isn't pulling in the right file. |
@IanLee1521 should I file a separate issue for the regression or should we reopen this to cover it? |
No, I think this was a regression introduced with some cleanup I did. See #380 for more details. I've tested against flake8 2.3.0 and commit 3bbaa23 and this seems to be resolved.
|
…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
I'm going to reopen this issue. I've reverted the majority of this fix in commit 435d1cb as it had some pretty serious repurcussions for flake8 users. I intend to circular back around and propose an improved solution to this that works for both pep8 and flake8, however, I've unfortunately not gotten as much time as I'd hoped to devote to that work. @jsnklln -- In response to:
I believe you're looking for https://gitlab.com/pycqa/flake8/blob/master/flake8/engine.py#L51 which returns a parser that looks for the |
2.2.0 (2016-11-14) ------------------ Bugs: * Fixed E305 regression caused by PyCQA#400; PyCQA#593 2.1.0 (2016-11-04) ------------------ Changes: * Report E302 for blank lines before an "async def"; PyCQA#556 * Update our list of tested and supported Python versions which are 2.6, 2.7, 3.2, 3.3, 3.4 and 3.5 as well as the nightly Python build and PyPy. * Report E742 and E743 for functions and classes badly named 'l', 'O', or 'I'. * Report E741 on 'global' and 'nonlocal' statements, as well as prohibited single-letter variables. * Deprecated use of `[pep8]` section name in favor of `[pycodestyle]`; PyCQA#591 Bugs: * Fix opt_type AssertionError when using Flake8 2.6.2 and pycodestyle; PyCQA#561 * Require two blank lines after toplevel def, class; PyCQA#536 * Remove accidentally quadratic computation based on the number of colons. This will make pycodestyle faster in some cases; PyCQA#314 2.0.0 (2016-05-31) ------------------ Changes: * Added tox test support for Python 3.5 and pypy3 * Added check E275 for whitespace on `from ... import ...` lines; PyCQA#489 / PyCQA#491 * Added W503 to the list of codes ignored by default ignore list; PyCQA#498 * Removed use of project level `.pep8` configuration file; PyCQA#364 Bugs: * Fixed bug with treating `~` operator as binary; PyCQA#383 / PyCQA#384 * Identify binary operators as unary; PyCQA#484 / PyCQA#485 1.7.0 (2016-01-12) ------------------ Changes: * Reverted the fix in PyCQA#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. * Added support for Python 3.5. (Issue PyCQA#420 & PyCQA#459) * Added support for multi-line config_file option parsing. (Issue PyCQA#429) * Improved parameter parsing. (Issues PyCQA#420 & PyCQA#456) Bugs: * Fixed BytesWarning on Python 3. (Issue PyCQA#459)
In the read_config function first the "user" config file is read then the directory tree is searched for "local" config files. If any config files exist within the directory tree they overwrite what was defined in the file specified by using --config. I've made a fork and plan on issuing a pull request soon. BTW I have no idea what I'm doing.
The text was updated successfully, but these errors were encountered: