Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): add lint def yaml #114

Merged
merged 3 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/test_and_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ on:
paths:
- '**.go'
- 'go.mod'
- '**.yml'
pull_request:
paths:
- '**.go'
- 'go.mod'
- '**.yml'

name: Test & Lint

Expand Down Expand Up @@ -39,7 +41,6 @@ jobs:
- run: go generate ./...
- name: Go vet
run: go vet ./...

- name: GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
Expand Down
68 changes: 68 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
linters-settings:
errcheck:
ignore: fmt:.*,io/ioutil:^Read.*
ignoretests: true

goimports:
local-prefixes: github.com/LagrangeDev/LagrangeGo

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
fast: false
enable:
- bodyclose
#- depguard
- dogsled
- errcheck
- exportloopref
- exhaustive
#- funlen
#- goconst
- gocritic
#- gocyclo
- gofmt
- goimports
- goprintffuncname
#- gosec
- gosimple
- govet
- ineffassign
#- misspell
- nolintlint
- rowserrcheck
- staticcheck
- stylecheck
- typecheck
- unconvert
- unparam
- unused
- whitespace
- prealloc
- predeclared
- asciicheck
- revive
- forbidigo
- makezero


run:
# default concurrency is a available CPU number.
# concurrency: 4 # explicitly omit this value to fully utilize available resources.
deadline: 5m
issues-exit-code: 1
tests: false
go: '1.23'

# output configuration options
output:
formats:
- format: "colored-line-number"
print-issued-lines: true
print-linter-name: true
uniq-by-line: true

issues:
# Fix found issues (if it's supported by the linter)
fix: true
Loading