Skip to content
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

Add configuration for Flake8. #476

Closed
wants to merge 1 commit into from

Conversation

HexDecimal
Copy link
Contributor

The main differences from the defaults are enabling the opinionated bugbear codes and excluding the vendored sources.

The main differences from the defaults are enabling the opinionated
bugbear codes and excluding the vendored sources.
@agronholm
Copy link
Contributor

Flake8 was meant to be run through pre-commit which already excludes the vendored sources.

@codecov
Copy link

codecov bot commented Oct 25, 2022

Codecov Report

Base: 69.16% // Head: 69.16% // No change to project coverage 👍

Coverage data is based on head (c3cdacb) compared to base (81471ec).
Patch has no changes to coverable lines.

Additional details and impacted files
@@            Coverage Diff             @@
##           publicapi     #476   +/-   ##
==========================================
  Coverage      69.16%   69.16%           
==========================================
  Files             11       11           
  Lines            989      989           
==========================================
  Hits             684      684           
  Misses           305      305           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@HexDecimal
Copy link
Contributor Author

I sometimes run it manually and it flags the vendored files when I do.

@agronholm
Copy link
Contributor

So, don't? Running flake8 manually only runs the flake8 checks and not the rest of the checks that need to pass for CI to pass. Just instead of flake8, run pre-commit run -a flake8 if you only want to run flake8 checks.

@agronholm
Copy link
Contributor

What makes this even more important is that, once I can, I will switch from the official flake8 to pyproject-flake8 so I can ditch setup.cfg entirely.

@HexDecimal
Copy link
Contributor Author

I mean things like the --max-complexity option are reasonable to be checked on manually.

@agronholm
Copy link
Contributor

Aside from the vendor exclusion, what's the rationale for these specific settings?

@HexDecimal
Copy link
Contributor Author

Git checks out files with CLRF on Windows, so I can't install the pre commit hooks unless I branch off of #474.

@HexDecimal
Copy link
Contributor Author

Aside from the vendor exclusion, what's the rationale for these specific settings?

select = B,B9,E,F,C9 mostly copied from the default settings from the Flake8 docs. W is excluded since Black handles those issues. B9 enables the extra bugbear codes which already pass, B enables the usual bugbear codes.
https://flake8.pycqa.org/en/latest/user/options.html#cmdoption-flake8-select

extend-ignore = E203 required for Black or else you can't have math in square brackets. Using extend-ignore will not replace the default commonly ignored codes which would conflict with Black.

@henryiii
Copy link
Contributor

This is now closable, as Ruff is used instead of flake8.

@HexDecimal HexDecimal closed this Mar 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants