Skip to content

build(ruff): enable lines-after-imports, DOC201/402/501 and UP042 - #26

Merged
furedea merged 1 commit into
mainfrom
build/enable-python-style-linters
Nov 14, 2026
Merged

furedea merged 1 commit into
mainfrom
build/enable-python-style-linters

Conversation

@furedea-agent

@furedea-agent furedea-agent Bot commented Nov 14, 2026

Copy link
Copy Markdown
Contributor

概要

  • agent-config PR #192 の「波 2: linter で有効化する規則」3 行を pyproject.toml に反映した.
  • [tool.ruff.lint.isort] lines-after-imports = 2 を追加し,preview 規則 DOC201,DOC402,DOC501,UP042 を select に明示した(explicit-preview-rules = true のため接頭辞 DOC では有効にならない).
  • template 自身のコードに違反はなく,修正は不要だった.

規則と置き換わる文章

規則 置き換える文章(agents/skills/python-style/)
isort lines-after-imports = 2 references/code_style.md の「Two blank lines before/after import statements」(グローバル変数の部分は残る)
DOC201 / DOC402 / DOC501 references/code_style.md の docstring の Returns/Yields と Raises の節(Args は D417)
UP042 references/models.md の StrEnum の指示のうち (str, Enum) の部分(agent-config 側の py_prefer_strenum は有効化後に削除できる)

違反件数(修正前)

規則 件数
lines-after-imports(I001) 0
DOC201 0
DOC402 0
DOC501 0
UP042 0

検証

  • nix develop --command uv run --frozen ruff check: All checks passed
  • nix develop --command uv run --frozen ruff format --check: 2 files already formatted
  • 一時ファイルで UP042,DOC201,DOC501,I001 が検出されることを確認した(DOC402 は同じ select 指定で,yield を含む例は未確認).
  • ruff 0.15.11 で 4 規則とも存在し,除外した規則はない.

Refs furedea/agent-config#74

🤖 Generated with Claude Code

Move the python-style prose rules into machine checks (furedea/agent-config#74).

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

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T09:23:50.145679Z 9468ef9 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.

@github-actions

Copy link
Copy Markdown

Review summary

No findings. The change is config-only (pyproject.toml):

  • DOC201, DOC402, DOC501 and UP042 are preview rules. Because explicit-preview-rules = true is set, they have to be listed by full code, and the PR does that correctly. The existing DOC prefix only turns on the stable DOC rules.
  • [tool.ruff.lint.isort] lines-after-imports = 2 works with ruff format, which keeps up to 2 blank lines at module level. In .pyi stubs ruff still caps the setting at 1, so stubs won't conflict.
  • The PR says the template code has no violations, so this shouldn't break CI. There's no runtime behavior to test.

Blocking findings: 0

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 9468ef9c1f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@furedea
furedea merged commit 7d8b3fb into main Nov 14, 2026
18 checks passed
@furedea
furedea deleted the build/enable-python-style-linters branch November 14, 2026 11:34
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