Skip to content

Commit f135182

Browse files
fix: golangci-lint and bump the versions of the golangci-lint (#300)
* fix: golangci-lint and bump the versions of the golangci-lint and corresponding GH action * fix: use the sonarqube-scan-action
1 parent 15f95ce commit f135182

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

.github/workflows/lint.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ jobs:
1515
uses: actions/setup-go@v5
1616
with:
1717
go-version: 1.21.x
18+
1819
- name: Checkout code
1920
uses: actions/checkout@v4
21+
2022
- name: golangci-lint
21-
uses: golangci/golangci-lint-action@v6
23+
uses: golangci/golangci-lint-action@v6.5.0
2224
with:
23-
version: v1.61
25+
version: v1.64.5
2426
args: --timeout=30m

.github/workflows/test-unit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Test
3434
run: make test-unit
3535

36-
- name: Analyze with SonarCloud
37-
uses: sonarsource/sonarcloud-github-action@master
36+
- name: SonarQube Scan
37+
uses: SonarSource/sonarqube-scan-action@v4.2.1
3838
env:
3939
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
40+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

.golangci.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@
33
run:
44
timeout: 3m
55
tests: true
6-
skip-dirs-use-default: true
7-
8-
service:
9-
golangci-lint-version: 1.61.0
106

117
linters:
128
disable-all: true
139
enable:
1410
- whitespace # Tool for detection of leading and trailing whitespace
15-
# - wsl # Forces you to use empty lines
1611
- wastedassign # Finds wasted assignment statements
1712
- unconvert # Unnecessary type conversions
1813
- tparallel # Detects inappropriate usage of t.Parallel() method in your Go test codes
@@ -21,7 +16,6 @@ linters:
2116
- prealloc # Finds slice declarations that could potentially be pre-allocated
2217
- predeclared # Finds code that shadows one of Go's predeclared identifiers
2318
- nolintlint # Ill-formed or insufficient nolint directives
24-
# - nlreturn # Checks for a new line before return and branch statements to increase code clarity
2519
- misspell # Misspelled English words in comments
2620
- makezero # Finds slice declarations with non-zero initial length
2721
- lll # Long lines
@@ -40,7 +34,7 @@ linters:
4034
# - godox # Linter for TODOs and FIXMEs left in the code
4135
- gci # Gci checks the consistency of the code with the Go code style guide
4236
- mnd # mnd is a linter for magic numbers
43-
# - revive
37+
# - revive
4438
- unparam # Unused function parameters
4539

4640
linters-settings:

0 commit comments

Comments
 (0)