Skip to content

ruff: enable the complexity rules - #50

Closed
krokicki wants to merge 1 commit into
mainfrom
complexity-rules
Closed

krokicki wants to merge 1 commit into
mainfrom
complexity-rules

Conversation

@krokicki

Copy link
Copy Markdown
Member

Follows #48 and #49, which brought the code to where these rules can be switched on. Config only plus nine noqa lines and a guide paragraph; no code change.

  • Rules: C901 (complexity 10), PLR0912 (12 branches), PLR0915 (50 statements), PLR0911 (8 returns: decide and _round return once per outcome), PLR0913 (6 parameters: more wants a parameter object like JobArgs or Reviewers), and RUF100 so a noqa that stops suppressing anything fails lint.
  • Tests are exempt from C901 and PLR0913: the fake activity dispatchers and fake services are one big switch each by design.
  • Kept whole, each with its reason on the noqa line: GitHub.request, _watch_pr, render_prompt, mia Activities.__init__, check_binding, run_test_pr, run_crop_test, _spec, publish.
  • Removed one stale noqa: BLE001 in test_mia_publish.py that RUF100 found.
  • docs/development.md states the limits and that the list of exceptions does not grow without a reason.

🤖 Generated with Claude Code

Defaults except max-args 6 and max-returns 8; tests are exempt from C901 and PLR0913 (fake dispatchers are
one switch each). The nine functions over the line keep a noqa with the reason on the same line. RUF100
catches a noqa that no longer suppresses anything (one stale BLE001 removed). The guide says what the limits
are and that a new noqa needs a reason.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@krokicki krokicki closed this Oct 16, 2026
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