Repository navigation
Run golangci-lint v1.64.8, the release the CI lint job installs, from make lint and the contributor docs, since golangci-lint 2.x does not load the v1-format .golangci.yml (#61) - #63
Merged
Conversation
… make lint and the contributor docs, since golangci-lint 2.x does not load the v1-format .golangci.yml (#61) The Makefile lint target, CONTRIBUTING.md lines 46, 55 and 165 and docs/development.md line 26 ran the golangci-lint on PATH. .golangci.yml is in the v1 configuration format: golangci-lint 2.12.2 stops on it with "can't load config: unsupported version of the configuration" and exit code 3, and the run command of golangci-lint 2.0.0 refuses a file without version: "2". The CI lint job asks golangci-lint-action@v4 for "latest", and its log reads "Requested golangci-lint 'latest', using 'v1.64.8'". make lint now runs golangci-lint through go run at GOLANGCI_LINT_VERSION, set to v1.64.8 in the Makefile, and both pages tell contributors to run make lint. CONTRIBUTING.md also gives the go run command for the same release without make. With golangci-lint 2.12.2 on PATH, make lint exited 0; the same command with -v named .golangci.yml as its config, listed six active linters (errcheck, gosimple, govet, ineffassign, staticcheck, unused) and reported 0 issues after processing. The configuration stays in the v1 format: golangci-lint v1.64.8 refuses a file that carries a version key ("you are using a configuration file for golangci-lint v2 with golangci-lint v1"), so the CI lint job would fail until it installs a 2.x release, and 2.12.2 reports 8 staticcheck issues with the file golangci-lint migrate writes. TestDocsLintCommandRunsTheGolangciLintReleaseTheConfigIsWrittenFor fails when the Makefile pins no release, when the pinned major version differs from the format of .golangci.yml, or when the Makefile, README.md, CONTRIBUTING.md or a page under docs has a golangci-lint run command that does not name the pinned release. On the tree before this change it reports the missing pin, Makefile:38, CONTRIBUTING.md:46, 55 and 165 and docs/development.md:26, and it passes after. TestGolangciLintProblems checks those rules on sample configurations, Makefiles and docs. Refs #61 Remaining: pin the CI lint job's golangci-lint version in .github/workflows/ci.yml, or move .golangci.yml to the v2 format together with a golangci-lint-action release that installs 2.x.
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.
This pull request lands 1 commit in
Makefile,CONTRIBUTING.md,docs/development.md,CHANGELOG.mdandcmd/cryptodeps.Included
Verified on this exact tree
go build -v ./...: exit 0go vet ./...: exit 0make lint(go run github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.8 run ./...): exit 0, no issues printedgo test -race -p 4 -json ./...: exit 0; packages: 13 ok (13 of them reported as cached), 3 with no test files, 0 failed; top-level tests: 531 passed, 0 failed, 1 skipped; with subtests: 1630 passed, 0 failed, 1 skippedNot included
c6e3d8f: with it applied,go test -race -p 4 -json ./...failedTestRequirementsTxtVersionEndsWithItsSpecifierininternal/manifest(3 subtests), for exampledependency = cryptography ">=41.0, <43" at line 1, want cryptography "41.0, <43" at line 1Closes
Refs #61
How to merge
Rebase and merge, so that each change stays its own commit on
main.