1
0
mirror of https://github.com/fumiama/ReiBot.git synced 2026-06-05 00:50:25 +08:00

chore: make lint happy

This commit is contained in:
源文雨
2025-05-13 20:26:17 +09:00
parent a99f02bda1
commit 1683db37d0
2 changed files with 26 additions and 26 deletions

View File

@@ -9,16 +9,15 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Go 1.x - name: Set up Go 1.x
uses: actions/setup-go@v2 uses: actions/setup-go@master
with: with:
go-version: ^1.18 go-version: "1.20"
- name: Check out code into the Go module directory - name: Check out code into the Go module directory
uses: actions/checkout@v2 uses: actions/checkout@master
- name: Get dependencies - name: Get dependencies
run: | run: go mod tidy
go get -v -t -d ./...
- name: Build - name: Build
run: go build -v ./... run: go build -v ./...
@@ -30,8 +29,15 @@ jobs:
name: lint name: lint
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v2 - name: Set up Go 1.x
- name: golangci-lint uses: actions/setup-go@master
uses: golangci/golangci-lint-action@v2
with: with:
version: latest go-version: "1.20"
- name: Check out code into the Go module directory
uses: actions/checkout@master
- name: golangci-lint
uses: golangci/golangci-lint-action@master
with:
version: latest

View File

@@ -6,10 +6,6 @@ linters-settings:
goimports: goimports:
local-prefixes: github.com/fumiama/ReiBot local-prefixes: github.com/fumiama/ReiBot
gocritic:
disabled-checks:
- exitAfterDefer
linters: linters:
# please, do not use `enable-all`: it's deprecated and will be removed soon. # 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 # inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@@ -17,42 +13,38 @@ linters:
fast: false fast: false
enable: enable:
- bodyclose - bodyclose
- deadcode #- depguard
- depguard
- dogsled - dogsled
- dupl
- errcheck - errcheck
- exportloopref #- exportloopref
- exhaustive - exhaustive
#- funlen #- funlen
#- goconst #- goconst
#- gocritic - gocritic
#- gocyclo #- gocyclo
- gofumpt - gofmt
- goimports - goimports
- goprintffuncname - goprintffuncname
#- gosec #- gosec
- gosimple - gosimple
- govet - govet
- ineffassign - ineffassign
- misspell #- misspell
- nolintlint - nolintlint
- rowserrcheck - rowserrcheck
- staticcheck - staticcheck
- structcheck - stylecheck
#- stylecheck
- typecheck - typecheck
- unconvert - unconvert
- unparam - unparam
- unused - unused
- varcheck
- whitespace - whitespace
- prealloc - prealloc
- predeclared - predeclared
- asciicheck - asciicheck
#- revive - revive
- forbidigo
- makezero - makezero
- interfacer
run: run:
@@ -61,10 +53,12 @@ run:
deadline: 5m deadline: 5m
issues-exit-code: 1 issues-exit-code: 1
tests: false tests: false
go: '1.20'
# output configuration options # output configuration options
output: output:
format: 'colored-line-number' formats:
- format: "colored-line-number"
print-issued-lines: true print-issued-lines: true
print-linter-name: true print-linter-name: true
uniq-by-line: true uniq-by-line: true