-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(linters): added golangci-lint (#306)
* ci(linters): added golangci-lint Signed-off-by: shanduur-dell <[email protected]> * trigger GitHub actions --------- Signed-off-by: shanduur-dell <[email protected]> Co-authored-by: Jooseppi Luna <[email protected]>
- Loading branch information
1 parent
1c44150
commit 9b069c1
Showing
2 changed files
with
60 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,30 @@ | ||
name: linters | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: ["**"] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
golangci-lint: | ||
name: golangci-lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.20" | ||
cache: false | ||
- name: Checkout the code | ||
uses: actions/[email protected] | ||
- name: Vendor packages | ||
run: | | ||
go mod vendor | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
version: v1.53 | ||
skip-cache: true |
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,30 @@ | ||
run: | ||
timeout: 20m | ||
issue-exit-code: 0 # we will change this later | ||
tests: true | ||
skip-dirs-use-default: true | ||
modules-download-mode: readonly | ||
|
||
issues: | ||
max-issues-per-linter: 0 | ||
max-same-issues: 0 | ||
new: false | ||
|
||
output: | ||
print-linter-name: true | ||
sort-results: true | ||
uniq-by-line: false | ||
print-issued-lines: true | ||
|
||
linters: | ||
disable-all: true | ||
fast: false | ||
enable: | ||
# A stricter replacement for gofmt. | ||
- gofumpt | ||
# Inspects source code for security problems. | ||
- gosec | ||
# Check for correctness of programs. | ||
- govet | ||
# Drop-in replacement of golint. | ||
- revive |