]> git.giacomolli.uk - onechat/commitdiff
Name the tools that check the Go rules
authorAnderson A. Giacomolli <redacted>
Mon, 9 Nov 2026 21:17:23 +0000 (18:17 -0300)
committerAnderson A. Giacomolli <redacted>
Mon, 9 Nov 2026 21:28:47 +0000 (18:28 -0300)
The skills identify the linters that enforce error, assertion, name, and
spacing rules. They keep manual review for logical groups, local error
paths, and the config exceptions because passing lint does not prove
those rules.

.agents/skills/check/SKILL.md
.agents/skills/go-code/SKILL.md

index 4dff349b611cba5432a75a0988342351ff6f4d86..e920bc388c1a61617477102bf0d306d9cf551484 100644 (file)
@@ -11,7 +11,10 @@ Run every command in the Nix development shell. Use
 ## Procedure
 
 1. Format all files with `bin/format`.
 ## Procedure
 
 1. Format all files with `bin/format`.
-2. Run the checks with `bin/check`.
+2. Run the checks with `bin/check`. Its golangci-lint config keeps the
+   standard linters and adds `errorlint`, `gocritic`, `testifylint`,
+   `revive`, `wrapcheck`, `nlreturn`, and `wsl_v5`. The settings in
+   `.golangci.yml` match the Go rules.
 3. Run `git add` on new files, then run `nix build` and
    `nix flake check`.
 4. Fix every failure and run the steps again. Do not disable a linter or
 3. Run `git add` on new files, then run `nix build` and
    `nix flake check`.
 4. Fix every failure and run the steps again. Do not disable a linter or
index 3d9e3f31d8b9c0cd299341119392139031046074..086360ad7319aa80fa2e8ea4f8ce53940ad6db3b 100644 (file)
@@ -22,7 +22,8 @@ description: Go style rules. Use before you write or review Go code.
 - Write type names with a capital letter, so that a variable can have
   the name of its type. Write all other package-level names in lower
   case.
 - Write type names with a capital letter, so that a variable can have
   the name of its type. Write all other package-level names in lower
   case.
-- Write all the letters of an initialism in one case.
+- Write all the letters of an initialism in one case. `revive` checks
+  common initialisms.
 - Put entry points first, then each struct's methods as a group, then
   standalone utility functions. Do not put a utility function between
   the methods of one type.
 - Put entry points first, then each struct's methods as a group, then
   standalone utility functions. Do not put a utility function between
   the methods of one type.
@@ -47,9 +48,12 @@ description: Go style rules. Use before you write or review Go code.
   different variable only to keep or join errors.
 - Use `errors.Is` and `errors.As` to examine errors. Do not compare an
   error directly with a sentinel, because errors can be wrapped.
   different variable only to keep or join errors.
 - Use `errors.Is` and `errors.As` to examine errors. Do not compare an
   error directly with a sentinel, because errors can be wrapped.
+  `errorlint` checks comparisons and type assertions on errors.
 - When a function has more than one error path, wrap each returned error
   with the context of its operation. A function with one error path can
 - When a function has more than one error path, wrap each returned error
   with the context of its operation. A function with one error path can
-  return the error directly.
+  return the error directly. `wrapcheck` checks package and interface
+  calls, with the exceptions in `.golangci.yml`. Review local calls and
+  the number of error paths by hand.
 - When deferred cleanup can fail, use a named `err` result and join the
   cleanup error with `errors.Join`.
 
 - When deferred cleanup can fail, use a named `err` result and join the
   cleanup error with `errors.Join`.
 
@@ -68,7 +72,8 @@ description: Go style rules. Use before you write or review Go code.
 - Put an empty line between logical blocks, also after multiline
   declarations, assignments, literals, and calls. Keep an operation with
   its immediate error or result check. Keep a short declaration with its
 - Put an empty line between logical blocks, also after multiline
   declarations, assignments, literals, and calls. Keep an operation with
   its immediate error or result check. Keep a short declaration with its
-  immediate use.
+  immediate use. `wsl_v5` and `nlreturn` check part of this rule. Review
+  the remaining logical blocks and immediate-use groups by hand.
 - Use GNU-style command flags: two dashes for long flags, such as
   `--cwd`, and one dash only for one-letter flags, such as `-h`.
 - Prefer the Go standard library. Prefer Go over cgo.
 - Use GNU-style command flags: two dashes for long flags, such as
   `--cwd`, and one dash only for one-letter flags, such as `-h`.
 - Prefer the Go standard library. Prefer Go over cgo.
@@ -86,7 +91,8 @@ description: Go style rules. Use before you write or review Go code.
 
 - Add tests for meaningful behavior. Do not add tests that only repeat
   implementation details.
 
 - Add tests for meaningful behavior. Do not add tests that only repeat
   implementation details.
-- Use `testify/require` for assertions.
+- Use `testify/require` for assertions. `testifylint` checks the
+  assertion forms.
 - Name a table-driven case slice `testCases` and its range variable
   `tc`. A subtest name describes the behavior, not a generic outcome or
   input.
 - Name a table-driven case slice `testCases` and its range variable
   `tc`. A subtest name describes the behavior, not a generic outcome or
   input.