Skip to content

Commit 2cadaf5

Browse files
authored
dev: enable whitespace, dogsled, funlen on the repo (#746)
1 parent 86d7c05 commit 2cadaf5

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

.golangci.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ linters-settings:
4141
disabled-checks:
4242
- wrapperFunc
4343
- dupImport # https://github.com/go-critic/go-critic/issues/845
44+
funlen:
45+
lines: 100
46+
statements: 50
4447

4548
linters:
4649
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@@ -49,11 +52,10 @@ linters:
4952
- bodyclose
5053
- deadcode
5154
- depguard
52-
# - dogsled - TODO: enable it when golangci.com will support it.
55+
- dogsled
5356
- dupl
5457
- errcheck
55-
# - funlen - TODO: enable it when golangci.com will support it.
56-
# - godox - TODO: enable it when golangci.com will support it.
58+
- funlen
5759
- gochecknoinits
5860
- goconst
5961
- gocritic
@@ -78,9 +80,10 @@ linters:
7880
- unparam
7981
- unused
8082
- varcheck
81-
# - whitespace - TODO: enable it when golangci.com will support it.
83+
- whitespace
8284

8385
# don't enable:
86+
# - godox
8487
# - maligned,prealloc
8588
# - gochecknoglobals
8689

@@ -98,6 +101,6 @@ issues:
98101
# golangci.com configuration
99102
# https://github.com/golangci/golangci/wiki/Configuration
100103
service:
101-
golangci-lint-version: 1.17.x # use the fixed version to not introduce new linters unexpectedly
104+
golangci-lint-version: 1.19.x # use the fixed version to not introduce new linters unexpectedly
102105
prepare:
103106
- echo "here I can run custom commands, but no preparation needed for this repo"

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,9 @@ linters-settings:
917917
disabled-checks:
918918
- wrapperFunc
919919
- dupImport # https://github.com/go-critic/go-critic/issues/845
920+
funlen:
921+
lines: 100
922+
statements: 50
920923
921924
linters:
922925
# inverted configuration with `enable-all` and `disable` is not scalable during updates of golangci-lint
@@ -925,11 +928,10 @@ linters:
925928
- bodyclose
926929
- deadcode
927930
- depguard
928-
# - dogsled - TODO: enable it when golangci.com will support it.
931+
- dogsled
929932
- dupl
930933
- errcheck
931-
# - funlen - TODO: enable it when golangci.com will support it.
932-
# - godox - TODO: enable it when golangci.com will support it.
934+
- funlen
933935
- gochecknoinits
934936
- goconst
935937
- gocritic
@@ -954,9 +956,10 @@ linters:
954956
- unparam
955957
- unused
956958
- varcheck
957-
# - whitespace - TODO: enable it when golangci.com will support it.
959+
- whitespace
958960
959961
# don't enable:
962+
# - godox
960963
# - maligned,prealloc
961964
# - gochecknoglobals
962965
@@ -974,7 +977,7 @@ issues:
974977
# golangci.com configuration
975978
# https://github.com/golangci/golangci/wiki/Configuration
976979
service:
977-
golangci-lint-version: 1.17.x # use the fixed version to not introduce new linters unexpectedly
980+
golangci-lint-version: 1.19.x # use the fixed version to not introduce new linters unexpectedly
978981
prepare:
979982
- echo "here I can run custom commands, but no preparation needed for this repo"
980983
```

pkg/golinters/dogsled.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ func (Dogsled) Desc() string {
2121
}
2222

2323
func (d Dogsled) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) {
24-
2524
var res []result.Issue
2625
for _, f := range lintCtx.ASTCache.GetAllValidFiles() {
2726
v := returnsVisitor{

0 commit comments

Comments
 (0)