Skip to content

build(lint): enable go-style linter rules - #9

Merged
furedea merged 2 commits into
mainfrom
build/enable-go-style-linters
Nov 14, 2026
Merged

furedea merged 2 commits into
mainfrom
build/enable-go-style-linters

Conversation

@furedea-agent

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

Copy link
Copy Markdown
Contributor

概要

  • .golangci.yml に revive 5 規則,errcheck check-blank,testifylint,usetesting,thelper,ireturn を追加した.
  • .ls-lint.yml で pkg,util,common ディレクトリを禁止した.
  • テンプレート自身のコードに違反はなく,コード修正は不要だった.

規則と置き換える文章

設定ファイル 規則 置き換える文章(agent-config agents/skills/go-style/)
.golangci.yml revive var-naming 略語の表記(ID,URL,HTTP)
.golangci.yml revive receiver-naming レシーバ名の一貫性
.golangci.yml revive context-as-argument context.Context は第 1 引数
.golangci.yml revive error-return error は最後の戻り値
.golangci.yml revive flag-parameter bool 引数を避ける
.golangci.yml errcheck check-blank: true _ でエラーを無視しない
.golangci.yml testifylint require / assert の使い分け
.golangci.yml usetesting t.TempDir() / t.Setenv()
.golangci.yml thelper helper 先頭の t.Helper()
.golangci.yml ireturn 具象型を返す
.ls-lint.yml .dir で pkg / util / common を禁止 pkg/ util/ common/ を作らない

revive は規則を明示列挙すると列挙したものだけが有効になるため,既存の列挙へ追記した.ls-lint は RE2 の正規表現に否定先読みがないため,"**/{pkg,util,common}" キーに .dir: exists:0 を指定した.

違反件数(修正前)

全 11 規則で 0 件(golangci-lint run ./... は 0 issues.).ls-lint も 0 件で,pkg/(ファイルのみ),internal/util/,cmd/app/common/ を一時的に作ると検出されることを確認した(確認後に退避済み).

検証

  • nix develop --command golangci-lint run ./...(golangci-lint 2.14.0): 0 issues
  • ls_lint: 違反なし.pkg/,internal/util/,cmd/app/common/ を置くと失敗することを確認
  • lefthook の pre-commit,commit-msg(commitlint)が通過

Refs furedea/agent-config#74

🤖 Generated with Claude Code

Enable revive var-naming, receiver-naming, context-as-argument,

error-return and flag-parameter, errcheck check-blank, testifylint,

usetesting, thelper and ireturn. Forbid pkg, util and common

directories in ls-lint.

Refs 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-14T04:52:46.587004Z 8de41cd 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: I found no blocking issues and posted no inline comments.

This PR changes only lint configuration in .golangci.yml and .ls-lint.yml. All of the new settings are valid golangci-lint v2 options.

  • revive: the new rules are added to the existing list of named rules, so the rules that were already enabled stay on.
  • errcheck: check-blank sits under linters.settings as expected.
  • ls-lint: the **/{pkg,util,common} block with .dir: exists:0 only targets directories that should not exist. Leaving out the *files merge in that block is harmless.

There is no runtime code change, so no tests are needed. The PR description says the rule was checked by temporarily creating pkg/ and internal/util/, which covers both top-level and nested matches.

🤖 Generated with Claude Code

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5225c1ed6

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

Comment thread .ls-lint.yml Resolved
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@furedea

furedea commented Nov 14, 2026

Copy link
Copy Markdown
Owner

@codex review

@github-actions

Copy link
Copy Markdown

Review summary

I found no blocking issues and posted no inline comments.

  • .golangci.yml: the new linters (ireturn, testifylint, thelper, usetesting) and the revive rules are added to the existing lists. revive only runs the rules you list, so appending to that list keeps the earlier rules active. errcheck.check-blank works because default: standard already turns on errcheck. The existing code (main_test.go uses assert.Equal with t.Parallel()) should pass all of these.
  • .ls-lint.yml: using "**/{pkg,util,common}" with .dir: exists:0 is a reasonable way to ban these names, since RE2 has no negative lookahead. The PR says this was checked by hand against pkg/, internal/util/ and cmd/app/common/. I couldn't re-run it here because ls_lint and golangci-lint aren't installed in this environment.

This PR only changes config, so there's no runtime behaviour that needs tests.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 8de41cd777

ℹ️ 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 6516904 into main Nov 14, 2026
18 checks passed
@furedea
furedea deleted the build/enable-go-style-linters branch November 14, 2026 11:32
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