Skip to content

build(ruff): enable D (google convention) and N - #21

Merged
furedea merged 3 commits into
mainfrom
build/74-ruff-d-n
Nov 10, 2026
Merged

furedea merged 3 commits into
mainfrom
build/74-ruff-d-n

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

Refs furedea/agent-config#74

段階 1B(template-python): ruff の D(google convention,tests は対象外)と N を有効化した.ANN201 / ANN202 は ignore に無いので変更なし.

対応表

規則 ID 元の場所 元の規則(原文) 判定 実装 例のテスト 元の文章
D(pydocstyle,google) agents/skills/python-style/references/code_style.md:84 Always add docstrings to public APIs 既存 linter(ruff D) pyproject.toml の [tool.ruff.lint] select と [tool.ruff.lint.pydocstyle] なし(ruff 本体の規則) 残して併記
N(pep8-naming) agents/skills/python-style/references/code_style.md:25 Variables / functions / files: snake_case(Classes: UpperCamelCase) 既存 linter(ruff N) pyproject.toml の [tool.ruff.lint] select なし(ruff 本体の規則) 残して併記

D104 / D105 / D107 を ignore する理由(ユーザー判断)

D104(package の __init__),D105(magic method),D107(__init__)は ignore に加えた.D100〜D103 は有効のまま.

  • Google style guide にこれらの規則は無い
  • __init__ の引数はクラスの docstring に書く
  • magic method の振る舞いは protocol が定義している
  • 「公開 API には docstring」の方針に合う

違反数(この repo の設定で測定)

規則 有効化前 修正後
D100 1 0
D103 1 0
N 0 0

コミット

  • build(ruff): enable D (google convention) and N: 設定のみ
  • docs(main): add module and function docstrings: src/main.py に実質のある docstring を追加.pass は docstring と重複するため削除

修正ごとの設計上の理由

  • D100(src/main.py): モジュールの役割(テンプレートの entry point)を述べた.名前の言い換えではない
  • D103(main): 「何もしない雛形である」という呼び出し側が知るべき契約を書いた.引数・戻り値・例外が無い関数なので,これ以上の節は不要
  • pass の削除:docstring だけで本体が成立するため.抑止(noqa,ignore)や改名は使っていない

確認(nix develop)

  • ruff check,ruff format --check,ty check,pytest がすべて通過

🤖 Generated with Claude Code

furedea and others added 2 commits November 10, 2026 00:32
Refs furedea/agent-config#74

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Refs furedea/agent-config#74

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

furedea commented Nov 9, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 9, 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-10T05:14:49.824765Z
We couldn’t complete this review. Comment @codex review to try again.
5b9622a 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
"PERF",
"E",
"W",
"D",

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: Enabling D (even with convention = "google") keeps D206 and D300 active. Ruff's formatter documents both as conflicting with ruff format, so ruff format will now print a "rules may cause conflicts" warning. The ignore list already turns off W191/E111/E114/E117 for this exact reason, so for consistency consider also adding "D206" and "D300" there.

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.

Refuted with a measurement: with this config, ruff check and ruff format --check -v (ruff 0.15.11) print no "rules may cause conflicts" warning, and ruff check --select D206,D300 reports 0 violations. Ruff only warns when the formatter settings actually conflict with the rule. Here indent-style = "space" matches D206 and quote-style = "double" matches D300, so nothing is ignored. W191/E111/E114/E117 are ignored in this repo for other reasons (the 2-space TOML/Nix style), not because D206/D300 conflict.

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown

Review summary: I found no blocking issues (P0/P1: 0).

This PR turns on ruff D (google convention, with tests excluded) and N, and adds docstrings to src/main.py. Removing pass is fine because a function whose body is only a docstring is still valid.

  • P3 (pyproject.toml): D206/D300 stay active and conflict with ruff format, so the formatter will print a warning. Consider adding them to ignore next to the W191/E1xx entries that are already there.

Tests: these are config-only lint changes, so they don't need new tests. Note: I couldn't run ruff locally (it isn't installed in the review environment). This review is based on reading the code.

🤖 Generated with Claude Code

Google style has no rule for these. __init__ arguments belong in the class docstring.

Magic methods are defined by their protocol.

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

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 blocking issues found. I didn't post any inline comments.

  • pyproject.toml: D is enabled with the google convention, and D104, D105 and D107 are ignored as the description explains. N is also enabled. Tests are excluded from D through per-file-ignores. The config looks consistent.
  • src/main.py: the new module and function docstrings cover D100 and D103. Removing pass doesn't change behavior because a docstring alone is a valid function body.
  • Tests: this PR only changes lint settings and docstrings, with no runtime behavior change, so no new tests are needed.

🤖 Generated with Claude Code

@furedea
furedea merged commit 19e04ee into main Nov 10, 2026
16 of 18 checks passed
@furedea
furedea deleted the build/74-ruff-d-n branch November 10, 2026 05:59
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