Hi code quality folks,
I'd like to use flake8 to enforce no trailing whitespace, except in
comments. Is there a way to do this? My main use case is to have
compatibility with autopep8, which does not remove trailing whitespace from
comments.
Thanks,
Jacob
Hi
On circle ci when I run flake I get the following error, but when I run
it locally everything runs smoothly and I am uncapable of reprducing it,
but somehow on circle ci fails.
Does anyone have an idea what it could be the issue, see Error below
Thanks in advance for any hints and your time.
Best,
Farncesc
The error:
flake8 --ignore=E712 background_tasks Traceback (most recent call last):
File "/home/ubuntu/virtualenvs/venv-3.5.1/bin/flake8", line 5, in
<module> main() File
"/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/run.py",
line 48, in main options, args = pep8.process_options() File
"/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/pep8.py",
line 1343, in process_options options.physical_checks =
find_checks('physical_line') File
"/home/ubuntu/virtualenvs/venv-3.5.1/lib/python3.5/site-packages/flake8/pep8.py",
line 812, in find_checks for name, function in globals().items():
RuntimeError: dictionary changed size during iteration
We have multiple python projects over multiple (private) repos in github
and I would like all of them to share a standard, organization-wide style
(eg. line length, any explicit select/ignore settings, etc.). Each
individual project could have a configuration that contained
project-specific settings. This would normally be additional ignore
settings (eg. to gradually transition a project to our style rule by rule).
Ideally, a developer should be able to run a single command to do style
checks.
I'm looking for guidance about how to go about doing this with flake8. What
I was thinking was that we'd have a private python package that brings in
flake8 plus any plugin packages and custom extensions (similar to hacking);
it would also bring in the global configuration file. In this way, projects
could simply add, say, <org>-flake8 to their requirements.txt file. I'm
pretty sure that we'd need a wrapper script to handle the global
configuration. The question is more about how to specify the global config
correctly.
flake8's doesn't seem to have the notion of a global base configuration;
the closest thing is the user configuration, but that is layered on top of
whatever project configuration there is. The "--config" argument isn't
useful as that forces a single configuration file. "--append-config" is a
possibility. A wrapper that runs flake8 with --append-config to layer first
global + local could work but local settings would have to be in a fixed
file. We'd layer local-global-local. That's sort of ok, but would lead to
surprising results if a dev put settings in say "setup.cfg" and the wrapper
always tried ".flake8" (though we could minimize such surprises by
specifying all known project file names..).
Is there another way to go about this that I haven't considered? Would it
be reasonable to add a "--prepend-config" argument? In which case the
layering order would be prepend, local files, append, user. (Happy to
submit a PR or whatever the gitlab equivalent is.)
Thanks,
liam
--
Liam Stewart :: liam.stewart(a)gmail.com
Hi all,
I've tagged (not released to PyPI) 3.1.0b1 of Flake8. It includes a
number of bug fixes:
http://flake8.pycqa.org/en/latest/release-notes/3.1.0.html
If no one finds anything wrong with it, I'll be releasing it on Monday the 14th.
Cheers!
Ian
I upgraded from flake8 2.5.4 to 3.0.4 and my .tox directory was no longer
excluded by default. I didn't find any documentation on this change.
It would be great if you either:
- fixed this (i.e. exclude .tox by default)
- documented the breaking change
Jaime