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

Set upper limits on code complexity #6339

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jan 28, 2025

Thank you for contributing to Pipenv!

The issue

Disabling ruff rules PLR0912 and PLR0913 has disabled the limits on code complexity ruff.lint.pylint.max-args (which has now doubled) and ruff.lint.pylint.max-branches (which has increased by 14). Using numbers forces discussion in code reviews about why the increase in complexity is good for the project. Disabling the rules blinds maintainers to pull requests that increase code complexity. Refactoring functions to make them less complex improves the project's maintainability.

Upgrade to ruff to the current v0.9.3 and also enforce collapsible-else-if (PLR5501) for fewer lines and less indentation.

The fix

How does this pull request fix your problem? Did you consider any alternatives? Why is this the best solution, in your opinion?

The checklist

  • Associated issue
  • A news fragment in the news/ directory to describe this fix with the extension .bugfix.rst, .feature.rst, .behavior.rst, .doc.rst. .vendor.rst. or .trivial.rst (this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.

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.

1 participant