Repository navigation
build: enable nolintlint, paralleltest and revive default rules - #8
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
| - gocognit | ||
| - gocyclo | ||
| - gosec | ||
| - nolintlint |
There was a problem hiding this comment.
P2: With its default settings, nolintlint doesn't enforce the rule this PR maps it to ("Every //nolint names the linter and carries a reason"). require-specific and require-explanation are both false by default, so a bare //nolint or //nolint:paralleltest with no // <reason> still passes. Only unused or malformed directives get reported. The PR description says nolintlint checks that a reason is present, but it won't until these are set:
settings:
nolintlint:
require-specific: true
require-explanation: trueThere was a problem hiding this comment.
対応しました(14e007d).nolintlint に require-specific: true と require-explanation: true を設定し,golangci-lint run ./... は 0 issues です.
Review summaryFindings: one P2, nothing blocking. No P0 or P1.
The other changes look correct:
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@codex review |
Review summaryNo findings. I checked the
Blocking findings (P0/P1): 0 |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Refs furedea/agent-config#74
概要
段階 1B として,template-go の golangci-lint で無効だった規則を有効化し,出た違反を直した.
nolintlintとparalleltestをlinters.enableに追加rulesを指定すると既定の規則が外れるため,package-commentsとexportedを独自の 3 規則と併記nolintlintは既定では linter 名と理由を要求しないため,require-specificとrequire-explanationをtrueにした(claude-review の P2 への対応)規則の対応表
nolintlintagents/skills/go-style/references/tooling.md:35//nolintnames the linter and carries a reasonnolintlint).golangci.yml//nolintを使う箇所なし)paralleltestagents/skills/go-style/references/testing.md:9t.Parallel()when cases share no stateparalleltest).golangci.ymlmain_test.goのTestGreetingで確認package-commentsagents/skills/go-style/references/code_style.md:18package-comments).golangci.ymlmain.goのパッケージコメントで確認exportedagents/skills/go-style/references/code_style.md:18exported).golangci.ymlparalleltestの「原文」は,並列にできない場合を例外とする文なので,linter が常に強制する範囲より狭い.並列にできないテストは//nolint:paralleltest // <reason>で理由を書く(nolintlintが理由の有無を検査する).違反数(
golangci-lint run ./...,リポジトリ自身の設定)paralleltestmain_test.go:9)package-commentsmain.go:1)nolintlintexported修正
main_test.go:TestGreetingの先頭にt.Parallel()を追加.greeting()は純粋関数でテスト間に共有状態がなく,testing.md:9 の「状態を共有しないなら並列」に当たるため,//nolint:paralleltestで黙らせず実際に並列化するのが正しい.main.go: パッケージコメント// Command template-go prints a greeting and serves as the starting point for new Go projects.を追加.名前の言い換えではなく,このコマンドが何をするかと,テンプレートとしての役割を呼び出し側(godoc の読者)向けに述べている.確認
nix develop --command golangci-lint run ./...: 0 issuesnix develop --command go test ./...: ok計画からの変更
なし.
🤖 Generated with Claude Code