-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: use canonical golangci-lint github action #12134
Changes from 31 commits
d952235
400fef3
960919a
9dffa36
edc57bb
4118316
9db408c
0b66c4d
241a808
3e991f1
f022bd3
75ef457
d801c2f
d2cabb0
30cb49a
9847ac8
b08f344
deffbbc
ea5438d
26036ef
95ac2de
075af32
a6f1498
18835a4
bd5667e
18becdf
d382053
388eff7
6b97db8
ca29bf1
a53a342
8961afe
a503ef7
c16f56e
3ae1cc6
9e1cbb4
d78d968
0461757
24c2175
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,26 @@ | ||
name: Lint | ||
# Lint runs golangci-lint over the entire cosmos-sdk repository | ||
# This workflow is run on every pull request and push to main | ||
# The `golangci` will pass without running if no *.{go, mod, sum} files have been changed. | ||
name: golangci-lint | ||
on: | ||
pull_request: | ||
push: | ||
tags: | ||
- v* | ||
branches: | ||
- main | ||
pull_request: | ||
permissions: | ||
contents: read | ||
# Optional: allow read access to pull request. Use with `only-new-issues` option. | ||
# pull-requests: read | ||
jobs: | ||
golangci: | ||
name: golangci-lint | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: 1.18 | ||
- uses: technote-space/[email protected] | ||
id: git_diff | ||
with: | ||
PATTERNS: | | ||
**/**.go | ||
go.mod | ||
go.sum | ||
- name: Get data from Go build cache | ||
# if: env.GIT_DIFF | ||
if: ${{ false }} | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/go/pkg/mod | ||
~/.cache/golangci-lint | ||
~/.cache/go-build | ||
key: ${{ runner.os }}-go-build-${{ hashFiles('**/go.sum') }} | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
if: env.GIT_DIFF | ||
uses: golangci/golangci-lint-action@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we have to migrate away from this action since it doesn't support workspaces or multiple go.mods in a single repo for now. |
||
with: | ||
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version | ||
version: latest | ||
args: --out-format=tab | ||
skip-go-installation: true |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1299,6 +1299,7 @@ func (s *IntegrationTestSuite) TestGetAccountsCmd() { | |
|
||
func TestGetBroadcastCommandOfflineFlag(t *testing.T) { | ||
clientCtx := client.Context{}.WithOffline(true) | ||
//nolint:staticcheck // this is intentionally setting a new value to clientCtx to affect later commands. | ||
clientCtx = clientCtx.WithTxConfig(simapp.MakeTestEncodingConfig().TxConfig) | ||
|
||
cmd := authcli.GetBroadcastCommand() | ||
|
@@ -1789,6 +1790,7 @@ func (s *IntegrationTestSuite) TestAuxToFeeWithTips() { | |
tc.feePayerArgs..., | ||
) | ||
|
||
//nolint:gocritic // rewriting this as a switch statement didn't make sense. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is totally what I mean about codecov There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. eg:
|
||
if tc.expectErrBroadCast { | ||
require.Error(err) | ||
} else if tc.errMsg != "" { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we usually opt to have this to not run this position of ci when there are no changes to the go code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recommend that we run it all the time since the compute to do that costs nothing and the previous setup resulted in not linting at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But there's no sense in running it if there are zero code changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I can roll with it, I’ll make that change I’m just worried that I could introduce another bug that reproduces the prior state
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this change, after this we can look at merging