Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 6 additions & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,7 @@ jobs:
with:
go-version-file: 'go.mod'

- name: Verify dependencies
run: |
go mod verify
go mod download

LINT_VERSION=1.63.4
curl -fsSL https://github.com/golangci/golangci-lint/releases/download/v${LINT_VERSION}/golangci-lint-${LINT_VERSION}-linux-amd64.tar.gz | \
tar xz --strip-components 1 --wildcards \*/golangci-lint
mkdir -p bin && mv golangci-lint bin/

- name: Run checks
- name: Ensure go.mod and go.sum are up to date
run: |
STATUS=0
assert-nothing-changed() {
Expand All @@ -49,10 +39,10 @@ jobs:
STATUS=1
fi
}

assert-nothing-changed go fmt ./...
Copy link
Member Author

Choose a reason for hiding this comment

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

This is handled directly by golangci-lint now with

formatters:
  enable:
    - gofmt

assert-nothing-changed go mod tidy

bin/golangci-lint run --out-format=colored-line-number --timeout=3m || STATUS=$?
Copy link
Member Author

Choose a reason for hiding this comment

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

colored-line-number has been enabled by default.

--out-format seems to have been removed.


exit $STATUS

- name: golangci-lint
uses: golangci/golangci-lint-action@4afd733a84b1f43292c63897423277bb7f4313a9 # v8.0.0
with:
version: v2.1.6
14 changes: 12 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
version: "2"

linters:
enable:
- gofmt
- nolintlint
- nolintlint
disable:
# The following linters are disabled purely because this config was migrated to v2 where they are in the default
# set, and we should have separate work to enable them if we truly want them.
Comment on lines +7 to +8
Copy link
Member

Choose a reason for hiding this comment

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

Thanks for clarification. 🙏

- staticcheck
- errcheck

formatters:
enable:
- gofmt

issues:
max-issues-per-linter: 0
Expand Down
Loading