@@ -229,6 +229,7 @@ lll: Reports long lines [fast: true, auto-fix: false]
229
229
maligned: Tool to detect Go structs that would take less memory if their fields were sorted [fast: true, auto-fix: false]
230
230
misspell: Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
231
231
nakedret: Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
232
+ nestif: Reports deeply nested if statements [fast: true, auto-fix: false]
232
233
prealloc: Finds slice declarations that could potentially be preallocated [fast: true, auto-fix: false]
233
234
rowserrcheck: checks whether Err of rows is checked successfully [fast: true, auto-fix: false]
234
235
scopelint: Scopelint checks for unpinned variables in go programs [fast: true, auto-fix: false]
@@ -492,6 +493,7 @@ golangci-lint help linters
492
493
- [gomodguard](https://github.com/ryancurrah/gomodguard) - Allow and block list linter for direct Go module dependencies.
493
494
- [godot](https://github.com/tetafro/godot) - Check if comments end in a period
494
495
- [testpackage](https://github.com/maratori/testpackage) - linter that makes you use a separate _test package
496
+ - [nestif](https://github.com/nakabonne/nestif) - Reports deeply nested if statements
495
497
496
498
## Configuration
497
499
@@ -710,6 +712,9 @@ linters-settings:
710
712
gocognit:
711
713
# minimal code complexity to report, 30 by default (but we recommend 10 -20 )
712
714
min-complexity: 10
715
+ nestif:
716
+ # minimal complexity of if statements to report, 5 by default
717
+ min-complexity: 4
713
718
goconst:
714
719
# minimal length of string constant, 3 by default
715
720
min-len: 3
@@ -777,8 +782,8 @@ linters-settings:
777
782
modules: # List of blocked modules
778
783
# - github.com/uudashr/go-module: # Blocked module
779
784
# recommendations: # Recommended modules that should be used instead (Optional)
780
- # - golang.org/x/mod
781
- # reason: "`mod` is the official go.mod parser library." # Reason why the recommended module should be used (Optional)
785
+ # - golang.org/x/mod
786
+ # reason: "`mod` is the official go.mod parser library." # Reason why the recommended module should be used (Optional)
782
787
govet:
783
788
# report about shadowed variables
784
789
check-shadowing: true
@@ -1288,6 +1293,7 @@ Thanks to developers and authors of used linters:
1288
1293
- [ryancurrah](https://github.com/ryancurrah)
1289
1294
- [tetafro](https://github.com/tetafro)
1290
1295
- [maratori](https://github.com/maratori)
1296
+ - [nakabonne](https://github.com/nakabonne)
1291
1297
1292
1298
## Changelog
1293
1299
0 commit comments