question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Adopting use of flake8 plugins

See original GitHub issue

In 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 codebase
  • flake8-gramex PyPI: checks for magic numbers and required encoding 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:open
  • Created 5 years ago
  • Comments:50 (50 by maintainers)

github_iconTop GitHub Comments

2reactions
webknjazcommented, Jun 12, 2020

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.

2reactions
deveshkscommented, Jun 12, 2020

I wonder if we want to add flake8-builtins to the pending list of plugins to try.

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found