Skip to content

[CI] update golangci-lint#8223

Merged
peterargue merged 9 commits intomasterfrom
peter/fix-ci-lint
Dec 4, 2025
Merged

[CI] update golangci-lint#8223
peterargue merged 9 commits intomasterfrom
peter/fix-ci-lint

Conversation

@peterargue
Copy link
Copy Markdown
Contributor

@peterargue peterargue commented Dec 4, 2025

The "Build Custom Linter" was failing:
https://github.com/onflow/flow-go/actions/runs/19903386660/job/57055284623#step:6:7

Install golangci-lint

Run golangci/golangci-lint-action@v6
prepare environment
run golangci-lint
  Running [/home/runner/golangci-lint-1.64.8-linux-amd64/golangci-lint config path] in [/home/runner/work/flow-go/flow-go] ...
  Running [/home/runner/golangci-lint-1.64.8-linux-amd64/golangci-lint run  --no-config --disable-all] in [/home/runner/work/flow-go/flow-go] ...
  Error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)
  Failed executing command with error: can't load config: the Go language version (go1.24) used to build golangci-lint is lower than the targeted Go version (1.25.0)  
  Error: golangci-lint exit with code 3
  Ran golangci-lint in 85ms


Build Customer Linter binary

Run golangci-lint custom
Error: build process: clone golangci-lint: git clone --branch v1.63.4 --single-branch --depth 1 -c advice.detachedHead=false -q https://github.com/golangci/golangci-lint.git: exit status 128
Failed executing command with error: build process: clone golangci-lint: git clone --branch v1.63.4 --single-branch --depth 1 -c advice.detachedHead=false -q https://github.com/golangci/golangci-lint.git: exit status 128
Error: Process completed with exit code 3.

@peterargue peterargue requested a review from a team as a code owner December 4, 2025 01:24
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Dec 4, 2025

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails
actions/golangci/golangci-lint-action 9.*.* 🟢 6.8
Details
CheckScoreReason
Maintained🟢 1030 commit(s) and 8 issue activity found in the last 90 days -- score normalized to 10
Code-Review⚠️ 0Found 0/13 approved changesets -- score normalized to 0
Packaging⚠️ -1packaging workflow not detected
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Token-Permissions🟢 9detected GitHub workflow tokens with excessive permissions
Binary-Artifacts🟢 10no binaries found in the repo
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies⚠️ 0dependency not pinned by hash detected -- score normalized to 0
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 10security policy file detected
Branch-Protection🟢 4branch protection is not maximal on development and all release branches
Vulnerabilities🟢 91 existing vulnerabilities detected
SAST🟢 10SAST tool is run on all commits

Scanned Files

  • .github/workflows/ci.yml

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Copy Markdown
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

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

Thank you for fixing this! 🙏

Comment thread .github/workflows/ci.yml Outdated
Comment thread .golangci.yml
description: "disallow struct field writes outside constructor"
original-url: "github.com/onflow/flow-go/tools/structwrite"

version: "2"
Copy link
Copy Markdown
Contributor Author

@peterargue peterargue Dec 4, 2025

Choose a reason for hiding this comment

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

made these changes using the migration tool

golangci-lint migrate

Comment thread .golangci.yml
Comment on lines +20 to +37
# TODO: these were added to allow updating to the latest version of the linter.
# Update the code to remove these issues instead of suppressing them.
- -QF1001 # could apply De Morgan's law" were hidden
- -QF1003 # could use tagged switch on chainID (staticcheck)
- -QF1006 # could lift into loop condition (staticcheck)
- -QF1008 # could remove embedded field \"BaseConfig\" from selector" were hidden
- -QF1011 # could omit type flow.IdentifierList from declaration; it will be inferred from the right-hand side" were hidden
- -QF1012 # Use fmt.Fprintf(...) instead of Write([]byte(fmt.Sprintf(...))) (staticcheck)
- -S1021 # should merge variable declaration with assignment on next line (staticcheck)
- -ST1003 # should not use underscores in package names" were hidden
- -ST1005 # error strings should not be capitalized" were hidden
- -ST1006 # receiver name should not be an underscore, omit the name if it is unused (staticcheck)
- -ST1008 # error should be returned as the last argument" were hidden
- -ST1012 # error var factoryError should have name of the form errFoo" were hidden
- -ST1016 # methods on the same type should have the same receiver name (seen 45x "db", 4x "s") (staticcheck)
- -ST1017 # don't use Yoda conditions" were hidden
- -ST1019 # other import of \"github.com/onflow/flow-go/model/bootstrap\"" were hidden
- -ST1023 # should omit type flow.IdentifierList from declaration; it will be inferred from the right-hand side" were hidden
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we should be able to fix most of these. I did some spot checks and there are dozens of issues to fix so I'll leave that for another PR

Copy link
Copy Markdown
Contributor

@tim-barry tim-barry left a comment

Choose a reason for hiding this comment

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

🙇

@peterargue peterargue added this pull request to the merge queue Dec 4, 2025
Merged via the queue into master with commit 5e9e009 Dec 4, 2025
61 checks passed
@peterargue peterargue deleted the peter/fix-ci-lint branch December 4, 2025 17:53
turbolent added a commit that referenced this pull request Dec 5, 2025
@peterargue peterargue changed the title [CI] update golanglint-ci [CI] update golangci-lint Dec 9, 2025
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.

4 participants