From a5225c1ed68886fb9e32ced1c08fc5c8a2126386 Mon Sep 17 00:00:00 2001 From: furedea <132188853+furedea@users.noreply.github.com> Date: Sat, 14 Nov 2026 13:44:28 +0900 Subject: [PATCH 1/2] build(lint): enable go-style linter rules 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 --- .golangci.yml | 11 +++++++++++ .ls-lint.yml | 4 ++++ 2 files changed, 15 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index 823aa15..ce6e950 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,10 +9,16 @@ linters: - gocognit - gocyclo - gosec + - ireturn - nolintlint - paralleltest - revive + - testifylint + - thelper + - usetesting settings: + errcheck: + check-blank: true gocognit: min-complexity: 15 gocyclo: @@ -23,6 +29,11 @@ linters: revive: rules: - name: package-comments + - name: var-naming + - name: receiver-naming + - name: context-as-argument + - name: error-return + - name: flag-parameter - name: exported - name: argument-limit arguments: [3] diff --git a/.ls-lint.yml b/.ls-lint.yml index 388b34f..cec238a 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -9,6 +9,10 @@ ls: <<: *files .dir: regex:[a-z0-9]+ + # Directories named after what they hold, never pkg, util or common. + "**/{pkg,util,common}": + .dir: exists:0 + ignore: - .git - .direnv From 8de41cd777f50bfeae60fd4588b65f17c9962183 Mon Sep 17 00:00:00 2001 From: furedea <132188853+furedea@users.noreply.github.com> Date: Sat, 14 Nov 2026 13:50:26 +0900 Subject: [PATCH 2/2] docs(lint): note ls-lint forbidden directory match depth Co-Authored-By: Claude Sonnet 5.5 --- .ls-lint.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.ls-lint.yml b/.ls-lint.yml index cec238a..7d41203 100644 --- a/.ls-lint.yml +++ b/.ls-lint.yml @@ -10,6 +10,7 @@ ls: .dir: regex:[a-z0-9]+ # Directories named after what they hold, never pkg, util or common. + # Matches such a directory at any depth even when it holds only files (verified). "**/{pkg,util,common}": .dir: exists:0