-
Notifications
You must be signed in to change notification settings - Fork 0
/
.golangci.yaml
53 lines (44 loc) · 2.16 KB
/
.golangci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
run:
concurrency: 4 # Moderate concurrency, you can adjust based on your system.
timeout: 3m # Linting will timeout after 3 minutes.
tests: false # Do not lint test files by default.
issues-exit-code: 1 # Exit with code 1 if any issue is found.
linters:
disable-all: true # Disable all linters by default.
enable:
- gofmt # Enforces gofmt formatting.
- goimports # Ensures imports are sorted.
- govet # Runs Go's vet tool for finding potential errors.
- errcheck # Ensures errors are checked.
- staticcheck # A collection of static analysis checks (highly recommended).
- gosimple # Simplifies Go code.
- unused # Checks for unused variables, constants, etc.
- revive # Code style and consistency linter.
# - gosec # Finds potential security issues.
linters-settings:
gofmt:
simplify: true # Simplify code using 'gofmt -s'.
staticcheck:
checks: ["all"] # Enable all staticcheck checks (good for best practices).
revive:
ignore-generated-header: true # Ignore generated files with specific headers.
severity: warning # Set the severity of all rules to 'warning'.
rules:
- name: context-as-argument # Enforce passing context.Context as the first argument.
- name: errorf # Enforce the use of `fmt.Errorf` for error formatting.
- name: indent-error-flow # Enforce proper error flow indentation.
issues:
max-issues-per-linter: 0 # No limit on the number of issues reported per linter.
max-same-issues: 0 # No limit on the number of the same issues reported.
exclude-use-default: false # Do not use default exclusions (no need for most personal projects).
output:
print-issued-lines: true # Print the actual code line where the issue is found.
print-linter-name: true # Show the name of the linter for each issue.
sort-results: true # Sort results by filename and line number.
exclude-dirs:
- .github
- .hooks
- .vscode
- snippets
exclude-files:
- README.md