Skip to content

build(ruff): drop the inactive CPY select - #22

Merged
furedea merged 2 commits into
mainfrom
build/align-lint-config
Nov 10, 2026
Merged

furedea merged 2 commits into
mainfrom
build/align-lint-config

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

概要

リンター設定を各リポジトリで揃えるための template-python 側の変更です.

  • CPY を select から削除:CPY は preview 専用のため,explicit-preview-rules 下では CPY の select は何も有効にしない死んだ項目です.個人リポジトリに著作権ヘッダも不要です.

PLR0917 を使わない理由

PLR0917(位置引数の数)は使いません.max-args = 3 の下では,位置引数の数は全引数の数を超えないため,PLR0913(引数の数)で常に先に検出されます.PLR0917 が新たに検出するものは存在しません(max-positional-args は未設定で,ruff が max-args を継承するため上限も同じ 3 です).

explicit-preview-rules 下では PLR0917 は有効になっておらず,この PR でも有効にしません.途中で追加した明示 select と tests/** の ignore は,このブランチの後続コミットで取り除いています.

検証

  • ruff check . / ruff format --check .: 全て pass

Refs furedea/agent-config#74

🤖 Generated with Claude Code

CPY001 is preview-only, fires on the template's own src/main.py, and
personal repositories need no copyright header.

PLR0917 is a preview rule, so under explicit-preview-rules the PLR
prefix does not enable it. Select it explicitly and ignore it in tests
only: pytest passes fixtures and parametrize values by name, so
positional-order mistakes cannot happen there.

Refs furedea/agent-config#74

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-10T10:47:48.319900Z
We couldn’t complete this review. Comment @codex review to try again.
834abd0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Comment thread pyproject.toml Outdated
"INP",
"C901",
"PLR1702",
"PLR0917",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: In src, enabling PLR0917 has almost no effect with the current settings. PLR0917 uses max-positional-args, which isn't set here, so it defaults to 5 and only fires at 6 or more positional args. But [tool.ruff.lint.pylint] max-args = 3 already makes PLR0913 fire at 4 or more args. So every function PLR0917 flags is already flagged by PLR0913, and you just get a second diagnostic. Your probe only showed PLR0917 on its own because tests/** also ignores PLR0913. If you want this rule to catch something extra, set max-positional-args below max-args (e.g. max-positional-args = 2, which forces keyword-only args past the second parameter). Otherwise it's fine as a harmless guard in case max-args is raised later.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 834abd0: PLR0917 is removed (select and tests ignore), since with max-args = 3 it is fully covered by PLR0913. The PR now only drops the inactive CPY select.

@github-actions

Copy link
Copy Markdown

Review summary

No blocking issues. This PR only changes the ruff config.

  • Dropping CPY: fine. It's a preview-only rule and the template doesn't need copyright headers.
  • Selecting PLR0917 explicitly: correct, since explicit-preview-rules = true means the PLR prefix alone doesn't turn it on. The tests/** ignore and its reasoning also make sense.
  • P3 (inline): with max-args = 3 and max-positional-args left at its default of 5, PLR0913 already flags everything PLR0917 would flag in src. So the new rule only adds a second diagnostic unless max-positional-args is set below max-args.

No tests are needed for a lint-config change.

Blocking findings (P0/P1): 0

PLR0917 is not used. With max-args = 3 it is fully covered by PLR0913:
the positional count never exceeds the total count, so it can never add
a finding. Revert the explicit select and the tests ignore added in the
previous commit; the CPY removal stays.

Refs furedea/agent-config#74

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea-agent furedea-agent Bot changed the title build(ruff): drop CPY and enable PLR0917 outside tests build(ruff): drop the inactive CPY select Nov 10, 2026
@furedea

furedea commented Nov 10, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions

Copy link
Copy Markdown

Review summary

No findings. The diff removes "CPY" from [tool.ruff.lint] select. The only rule in the CPY group is CPY001, and it is a preview rule. Because this config sets preview = true and explicit-preview-rules = true, selecting the CPY prefix never turned CPY001 on. Removing it leaves the set of enabled rules exactly the same, and no CPY rule appears anywhere else (ignores or per-file-ignores) that would be affected. Since lint behavior is unchanged, no new tests are needed.

Blocking findings (P0/P1): 0

@furedea
furedea merged commit 004d3ce into main Nov 10, 2026
16 of 18 checks passed
@furedea
furedea deleted the build/align-lint-config branch November 10, 2026 10:50
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