You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,3 +15,33 @@ The default values are used internally, but might to be adjusted for your specif
15
15
## Installation
16
16
17
17
Funlen is included in [golangci-lint](https://github.com/golangci/golangci-lint/). Install it and enable funlen.
18
+
19
+
# Exclude for tests
20
+
21
+
golangci-lint offers a way to exclude linters in certain cases. More info can be found here: https://golangci-lint.run/usage/configuration/#issues-configuration.
22
+
23
+
## Disable funlen for \_test.go files
24
+
25
+
You can utilize the issues configuration in `.golangci.yml` to exclude the funlen linter for all test files:
26
+
27
+
```yaml
28
+
issues:
29
+
exclude-rules:
30
+
# disable funlen for all _test.go files
31
+
- path: _test.go
32
+
linters:
33
+
- funlen
34
+
```
35
+
36
+
## Disable funlen only for Test funcs
37
+
38
+
If you want to keep funlen enabled for example in helper functions in test files but disable it specifically for Test funcs, you can use the following configuration:
0 commit comments