-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Ruleset suggestion: wemake-python-styleguide WPS2xx (complexity) #8022
Comments
WIP: repo/branch, issues |
@charliermarsh What's the best way to approach this? We now have a working group of people who are interested in implementing this. The most important question: do you even plan to include this? The amount of code, docs, and config is very significant maintaince burden. One more question about the workflow (if you plan to support this):
I think that |
That's great news! We're reworking our rule categorize (see #1774) and the rule acceptance guidelines. That's why I think it's important that someone on the team first goes through the rules and identifies the rules that we consider not a good fit for Ruff or where there's overlap with other rules that need figuring out to avoid unnecessary work. From looking at the list (without reading the rules in detail):
I strongly prefer 1. because it makes it easier to triage, review, and allows us to merge rules faster |
That's the whole point :) I think that adding individual rules does not make much sense, because they work as a complex. This is why I am asking about a plugin or a wrapper :) |
wemake-python-styleguide
(link) is a collection of plugins as well as a number of custom rules (WPSxxx). Implementing all rules outlined in #3845 seems to be an impossible task, so I suggest to tackle this step by step. The most useful section of WPS is a WPS2xx rules, focused on reducing overall unit complexity.I implemented WPS201, WPS202, WPS203, and plan to submit a PR in nearest time. I would appreciate help on other rules. Here is a list of WPS2xx rules:
Unlike mccabe (C90), WPS also relies on other metrics, like Jones complexity and cognitive complexity (as proposed by G. Ann Campbell). Some violations are covered by Pylint (PLR).
Forbid too many arguments for a function or method.covered by PLR0913Forbid placing too many return statements in a function.covered by PLR0911Forbid putting too many expressions in a single function.covered by PLR0915kinda covered by C901?
A complex format string is defined as use of any formatted value that is not:
The text was updated successfully, but these errors were encountered: