Skip to content

Commit afa3b21

Browse files
authored
task: fix golangci lint config (#54)
1 parent 5016c3b commit afa3b21

File tree

3 files changed

+7
-15
lines changed

3 files changed

+7
-15
lines changed

.github/workflows/pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: lint
2020
uses: golangci/[email protected]
2121
with:
22-
version: v1.56.1
22+
version: v1.56.2
2323

2424
tests-on-unix:
2525
needs: golangci-lint # run after golangci-lint action to not produce duplicated errors

.golangci.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,8 @@ linters-settings:
1111
gocyclo:
1212
min-complexity: 16
1313
govet:
14-
check-shadowing: true
15-
maligned:
16-
suggest-new: true
17-
tagliatelle:
18-
# check the struck tag name case
19-
case:
20-
use-field-name: true
21-
rules:
22-
json: camel
23-
yaml: camel
14+
enable:
15+
- shadow
2416
revive:
2517
# see https://github.com/mgechev/revive#available-rules for details.
2618
ignore-generated-header: true
@@ -60,7 +52,6 @@ linters:
6052
disable-all: true
6153
enable:
6254
- bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false]
63-
6455
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
6556
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false]
6657
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]
@@ -83,15 +74,16 @@ linters:
8374
- misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
8475
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
8576
- nolintlint # Reports ill-formed or insufficient nolint directives [fast: true, auto-fix: false]
77+
- perfsprint # Checks that fmt.Sprintf can be replaced with a faster alternative.
8678
- revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false]
8779
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
88-
- staticcheck #megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
80+
- staticcheck # megacheck): Staticcheck is a go vet on steroids, applying a ton of static analysis checks [fast: false, auto-fix: false]
8981
- stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false]
90-
- tagliatelle # Checks the struct tags. [fast: true, auto-fix: false]
9182
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false]
9283
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false]
9384
- unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false]
9485
- unparam # Reports unused function parameters [fast: false, auto-fix: false]
86+
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false]
9587
- unused # Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
9688
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]
9789

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
22

33
SOURCE_FILES?=./...
4-
GOLANGCI_VERSION=v1.56.1
4+
GOLANGCI_VERSION=v1.56.2
55
COVERAGE=coverage.out
66

77
export PATH := ./bin:$(PATH)

0 commit comments

Comments
 (0)