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

Ruff checks failing on master #2960

Closed
korverdev opened this issue Jul 23, 2023 · 2 comments · Fixed by #2962
Closed

Ruff checks failing on master #2960

korverdev opened this issue Jul 23, 2023 · 2 comments · Fixed by #2962

Comments

@korverdev
Copy link
Contributor

It appears something's changed with the latest version of ruff, causing the server-side checks to fail with the following output:

codespell_lib/_codespell.py:1003:5: PLR0912 Too many branches (49 > 48)

I was able to recreate this locally. v0.0.254 of the Pre-Commit hook passes all checks, but the latest version, v0.0.280, raises the same error.

@korverdev
Copy link
Contributor Author

Opened a separate issue to discuss a potential long-term solution for this and similar issues:
#2961

@DimitriPapadopoulos
Copy link
Collaborator

DimitriPapadopoulos commented Jul 24, 2023

Indeed ruff is still evolving rapidly resulting in new CI alerts without actual changes in our codebase (see for example #2796, #2802 or #2834). You just need to change:

max-branches = 48

to:

max-branches = 49

I had already tried to limit the number of branches in #2767, just to please ruff, resulting in artificial and useless changes, more complex code, or even hard to spot regressions. Ended up bumping max-branches from 48 to 50.

Or, alternatively, you can reorganise the code to remove branches, although I don't see anything wrong with multiple similar branches when parsing command line options.

Or perhaps you can add a noqa to the specific function.

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 a pull request may close this issue.

2 participants