Skip to content

Commit 4e8a736

Browse files
committed
fix build lint
1 parent 6f5a783 commit 4e8a736

File tree

3 files changed

+30
-28
lines changed

3 files changed

+30
-28
lines changed

.github/workflows/test-git.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
name: Build and test go-alpm
1616
runs-on: ubuntu-latest
1717
container:
18-
image: jguer/goalpm-builder:latest
18+
image: jguer/yay-builder:latest
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v2

.github/workflows/test.yml

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,11 @@ jobs:
1515
name: Build and test go-alpm
1616
runs-on: ubuntu-latest
1717
container:
18-
image: jguer/goalpm-builder:latest
18+
image: jguer/yay-builder:latest
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v2
2222
- name: Lint
2323
run: /app/bin/golangci-lint run ./...
2424
- name: Run Build and Tests
25-
run: make test
26-
- name: Build and install pacman-git
27-
run: |
28-
useradd github
29-
pacman -Sy --noconfirm --needed sudo base-devel git
30-
echo "github ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
31-
git clone https://aur.archlinux.org/pacman-git
32-
chown -R github pacman-git
33-
su github -c "cd pacman-git; yes | makepkg -si --nocheck"
34-
- name: Run Build and Tests with pacman-git
35-
run: make test
36-
25+
run: make test

.golangci.yml

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,52 @@ linters-settings:
1414
- opinionated
1515
- performance
1616
- style
17-
disabled-checks:
18-
- dupImport
1917
gocyclo:
2018
min-complexity: 15
2119
goimports:
22-
local-prefixes: github.com/Jguer/go-alpm/v2
20+
local-prefixes: github.com/Jguer/yay/v12
2321
gomnd:
24-
settings:
25-
mnd:
26-
# don't include the "operation" and "assign"
27-
checks: argument,case,condition,return
28-
govet:
29-
check-shadowing: true
22+
checks:
23+
- argument
24+
- case
25+
- condition
26+
- return
27+
ignored-numbers:
28+
- "0"
29+
- "1"
30+
- "2"
31+
- "3"
32+
ignored-functions:
33+
- strings.SplitN
3034
lll:
3135
line-length: 140
32-
maligned:
33-
suggest-new: true
3436
misspell:
3537
locale: US
38+
nolintlint:
39+
allow-unused: false # report any unused nolint directives
40+
require-explanation: false # don't require an explanation for nolint directives
41+
require-specific: false # don't require nolint directives to be specific about which linter is being skipped
3642

3743
linters:
3844
# please, do not use `enable-all`: it's deprecated and will be removed soon.
3945
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
4046
disable-all: true
4147
enable:
48+
- forbidigo
4249
- bodyclose
43-
- depguard
4450
- dogsled
4551
- dupl
46-
- errcheck
4752
- errorlint
53+
- errcheck
4854
- exportloopref
55+
# - funlen # TOFIX
4956
- gochecknoinits
57+
# - goconst # TOFIX
5058
- gocritic
59+
# - gocyclo # TOFIX
5160
- gofmt
5261
- goimports
62+
# - gomnd # TOFIX
5363
- goprintffuncname
5464
- gosec
5565
- gosimple
@@ -69,10 +79,12 @@ linters:
6979
- whitespace
7080

7181
run:
82+
go: "1.22"
83+
timeout: "10m"
7284

7385
issues:
7486
exclude-rules:
75-
- path: _test\.go
87+
- path: (.+)_test.go
7688
linters:
7789
- lll
7890
- revive
@@ -84,6 +96,7 @@ issues:
8496
- dupl
8597
- gocritic
8698
- gochecknoinits
99+
- errorlint
87100

88101
exclude:
89102
- G204

0 commit comments

Comments
 (0)