-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is the simple use of golangci-lint-action. The enabled by default linters as follows: errcheck, gosimple, govet, ineffassign, staticcheck, unused. The gosec, goimports are included in the linters. Signed-off-by: Sophia Wang <[email protected]>
- Loading branch information
1 parent
3983dd5
commit ed4e7f8
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: golangci-lint | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: './go.mod' | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v6 | ||
with: | ||
version: v1.60 |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
linters: | ||
enable: | ||
- errcheck # Checks for unchecked errors | ||
- gosimple # Finds code simplifications | ||
- govet # Vet checks for various errors | ||
- ineffassign # Finds useless assignments | ||
- staticcheck # Comprehensive static analysis | ||
- unused # Finds unused variables, functions, etc. | ||
- gosec # Security checks for Go code | ||
- goimports # Checks import statements are formatted |