Skip to content

Commit

Permalink
fix build lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed Mar 23, 2024
1 parent 6f5a783 commit 4e8a736
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test-git.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
name: Build and test go-alpm
runs-on: ubuntu-latest
container:
image: jguer/goalpm-builder:latest
image: jguer/yay-builder:latest
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
15 changes: 2 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,11 @@ jobs:
name: Build and test go-alpm
runs-on: ubuntu-latest
container:
image: jguer/goalpm-builder:latest
image: jguer/yay-builder:latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint
run: /app/bin/golangci-lint run ./...
- name: Run Build and Tests
run: make test
- name: Build and install pacman-git
run: |
useradd github
pacman -Sy --noconfirm --needed sudo base-devel git
echo "github ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
git clone https://aur.archlinux.org/pacman-git
chown -R github pacman-git
su github -c "cd pacman-git; yes | makepkg -si --nocheck"
- name: Run Build and Tests with pacman-git
run: make test

run: make test
41 changes: 27 additions & 14 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,42 +14,52 @@ linters-settings:
- opinionated
- performance
- style
disabled-checks:
- dupImport
gocyclo:
min-complexity: 15
goimports:
local-prefixes: github.com/Jguer/go-alpm/v2
local-prefixes: github.com/Jguer/yay/v12
gomnd:
settings:
mnd:
# don't include the "operation" and "assign"
checks: argument,case,condition,return
govet:
check-shadowing: true
checks:
- argument
- case
- condition
- return
ignored-numbers:
- "0"
- "1"
- "2"
- "3"
ignored-functions:
- strings.SplitN
lll:
line-length: 140
maligned:
suggest-new: true
misspell:
locale: US
nolintlint:
allow-unused: false # report any unused nolint directives
require-explanation: false # don't require an explanation for nolint directives
require-specific: false # don't require nolint directives to be specific about which linter is being skipped

linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon.
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
disable-all: true
enable:
- forbidigo
- bodyclose
- depguard
- dogsled
- dupl
- errcheck
- errorlint
- errcheck
- exportloopref
# - funlen # TOFIX
- gochecknoinits
# - goconst # TOFIX
- gocritic
# - gocyclo # TOFIX
- gofmt
- goimports
# - gomnd # TOFIX
- goprintffuncname
- gosec
- gosimple
Expand All @@ -69,10 +79,12 @@ linters:
- whitespace

run:
go: "1.22"
timeout: "10m"

issues:
exclude-rules:
- path: _test\.go
- path: (.+)_test.go
linters:
- lll
- revive
Expand All @@ -84,6 +96,7 @@ issues:
- dupl
- gocritic
- gochecknoinits
- errorlint

exclude:
- G204

0 comments on commit 4e8a736

Please sign in to comment.