Repository navigation
build: standardize golangci-lint tooling and rules - #102
Merged
Merged
Conversation
- Pin the linter separately from runtime dependencies - Use the same tool version for local checks and CI
- Apply the shared lint policy with module-specific imports - Resolve findings while preserving compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Synchronize
.golangci.ymlwith Signet, adapting only the local-module import prefix. Apply the enabled lint and formatting fixes so the same policy passes locally and in CI. Pin golangci-lint v2.14.0 ingo.tools.mod/go.tools.sum; Makefile formatting/lint targets and the CI lint job use this tool module. Include both runtime and tool sums in the lint cache. Preserve public APIs and observable behavior; narrowly explained suppressions cover legacy exported names, platform conversions, intentional nil-success contracts, or established output where applicable.Scope and review classification
Core change. Shared production code is touched; request two reviewers including the module owner, with line-by-line review of non-formatting changes.
Runtime Go module dependencies and existing non-lint CI test jobs remain unchanged. The tool module uses Go 1.26; application minimum versions are preserved. No Jira/GitHub issue was supplied.
flowchart TD CI[CI lint job] --> Make[Makefile lint] Make --> Tool[golangci-lint from go.tools.mod] Config[.golangci.yml shared policy] --> Tool Tool --> Source[Formatted and lint-clean Go code] style Config fill:#dff0d8,stroke:#3c763d style Source fill:#dff0d8,stroke:#3c763dVerification
Check out
chore/pin-golangci-lintand run commands from the repository root. Prerequisites: Go 1.26+, Make, network access for tool modules. A globally installed golangci-lint is unnecessary. Local execution used Go 1.26.7 on macOS/arm64.make lintgit diff --checkand staged equivalentReviewer scenario: run
go tool -modfile=go.tools.mod golangci-lint version, thenmake lint. Expect version 2.14.0 and 0 issues. Version resolution and lint passed locally. Inspect gci sections: standard imports, this module's imports, then third-party imports. Formatter and lint checks use the same module/configuration. No service setup or cleanup is needed for this scenario; test commands may generate local coverage files.AI authorship
AI used: Codex, including delegated code review and narrow lint repairs.
Human line-by-line reviewed: None — not yet reviewed by a human.
AI-authored or tool-generated files included in this PR:
.github/workflows/testing.ymlMakefile_examples/stream/stream.goeasyssh.goeasyssh_test.gogo.tools.modgo.tools.sumRisks and rollback
Review non-formatting production edits and compatibility suppressions carefully; inspect tests for environment restoration and fatal assertions only in the test goroutine. Spot-check generated tool sums and formatting-only changes. No secrets/credentials were introduced and no new external or permission interface is intended.
Revert the PR commits to restore the earlier tooling/rules. Source formatting spans many files in legacy repositories; it is required by the synchronized policy. Service-dependent checks still need their existing CI fixtures.
Go 1.26.8 upgrade
Upgrade every go.mod in this repository, including example modules, to Go 1.26.8. Update fixed CI Go versions where necessary. Existing dependency versions are unchanged.
Verification: run the following from the repository root with
GOTOOLCHAIN=go1.26.8:git diff --check— passed.make lint— passed.go test -mod=readonly -run ^$ ./...— passed._examples/proxy:go test -mod=readonly -run ^$ ./...— passed._examples/scp:go test -mod=readonly -run ^$ ./...— passed._examples/ssh:go test -mod=readonly -run ^$ ./...— passed._examples/stream:go test -mod=readonly -run ^$ ./...— passed._examples/writeFile:go test -mod=readonly -run ^$ ./...— passed.Full external-service integration suites were not run locally; compilation checks do not verify service behavior.
AI authorship: Codex authored the Go version and CI updates; no human line-by-line review yet.
Go test matrix
Test Go 1.26 and 1.27 across the existing OS/service combinations. Version-specific cache keys prevent sharing the same primary cache key across Go versions. Non-matrix jobs continue reading go.mod.
Validation: workflow YAML parsing, test-matrix assertions, and git diff --check passed. Remote CI results are pending; matrix jobs were not executed locally.
AI authorship: Codex authored the scoped changes; no human line-by-line review yet.