Adopting use of flake8 plugins
See original GitHub issueIn general, there’s some flake8 plugins that might be useful to us. In case of some of these plugins, it means adopting a newer code style so we should probably start with that discussion.
flake8-commas
PyPI: enforce commas after the last item of multiline literals/function calls.flake8-mutable
PyPI: enforce not using mutable values as defaults- TODO: check if flake8 does this check by default
flake8-logging-format
PyPI: check that strings aren’t formatted while passing to logging (should depend on logging doing the interpolation)flake8-pep3101
PyPI: enforces the use of.format
instead of%
in the codebaseflake8-gramex
PyPI: checks for magic numbers and requiredencoding
for calls to file opening functions + 2/3 more (but we’ll ignore those)- It’s documentation is lacking
I think some of these might be good additions. The only thing is that adopting them would mean going through the entire codebase to make things consistent according to them wherever there’s a violation (which is kind of the point of doing this).
Thoughts @pypa/pip-committers?
Issue Analytics
- State:
- Created 5 years ago
- Comments:50 (50 by maintainers)
Top Results From Across the Web
Using Plugins For Fun and Profit — flake8 6.0.0 documentation
Flake8 is useful on its own but a lot of Flake8's popularity is due to its extensibility. Our community has developed plugins that...
Read more >Using Flake8 and pyproject.toml with FlakeHell
FlakeHell is a Flake8 wrapper. Configuration is handled in pyproject.toml and can enable/disable specific Flake8 plugins, ignore specific errors ...
Read more >flake8 - Pants build
Paths to extra files to include in the sandbox. This can be useful for Flake8 plugins, like including config files for the flake8-bandit...
Read more >Using black and flake8 in tandem - Sorin Sbarnea's Crib
adoption requires a lot of code reformatting · some rules contradict each other, like W503 / W504 · different rules on different projects...
Read more >flake8-black - PyPI
The point of this plugin is to be able to run black --check ... from within the flake8 plugin ecosystem. You might use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Right. Also, FTR wemake-python-styleguide is developing a baseline support that would be very helpful in terms of invasiveness. Here’s also a few words on supporting “legacy” codebases that you may find interesting: https://wemake-python-stylegui.de/en/latest/pages/usage/integrations/legacy.html.
That’s a good idea too. I will probably give it a shot in a PR once I get some clarity on whether we want to use
flake8-comprehensions
or not.