tooling: Lower Pylint complexity thresholds in ruff.#297
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adjusts Ruff’s Pylint-equivalent complexity thresholds to be much less permissive (but still above current worst offenders) so new code can’t add additional complexity without explicit review, while keeping the current codebase passing lint.
Changes:
- Lower McCabe
max-complexityto 25. - Lower Pylint thresholds (
max-args,max-branches,max-returns,max-statements) to tighter values aligned with current violations. - Exempt
tests/**/*.pyfrom PLR0911/PLR0912/PLR0915 to avoid test infrastructure/control-flow lint churn.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
🎉 This PR is included in version 0.2.5 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lower the Pylint complexity thresholds from their current permissive values to just above the worst existing violations. This prevents new complex code from being introduced while accepting the existing codebase.
process_gesture_data)process_gesture_data)orientation)process_gesture_data)Test infrastructure files (
tests/) are exempt from PLR0911/PLR0912/PLR0915 as the test runner and report plugin inherently have complex control flow.The main offender is
apds9960.process_gesture_datawhich is a ported driver with inherently complex gesture recognition logic. Refactoring it is out of scope for this PR.Closes #291
Test plan
make cipasses