This repository was archived by the owner on Apr 26, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
124 lines (107 loc) · 3.14 KB
/
Copy path.golangci.yml
File metadata and controls
124 lines (107 loc) · 3.14 KB
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
run:
timeout: 5m
tests: true
modules-download-mode: readonly
linters:
enable:
# Default linters
- errcheck # Checks for unchecked errors
- gosimple # Simplifies code
- govet # Reports suspicious constructs
- ineffassign # Detects ineffectual assignments
- staticcheck # Advanced static analysis
- unused # Checks for unused code
# Additional recommended linters
- gofmt # Checks code is formatted
- goimports # Checks imports are formatted
- misspell # Finds commonly misspelled words
- revive # Fast, configurable, extensible linter
- gosec # Security-focused linter
- unconvert # Remove unnecessary type conversions
- unparam # Reports unused function parameters
- gocyclo # Checks cyclomatic complexity
- gocritic # Provides many diagnostics
- stylecheck # Replacement for golint
- errorlint # Find code that will cause problems with Go 1.13+ error wrapping
- bodyclose # Checks HTTP response body is closed
- nilerr # Finds code that returns nil even if error is checked
- godot # Checks comments end in a period
- prealloc # Finds slice declarations that could be preallocated
linters-settings:
gofmt:
simplify: true
goimports:
local-prefixes: github.com/jrh3k5/cryptonabber-offramp
govet:
enable-all: true
disable:
- shadow # Can be too strict for some codebases
- fieldalignment # Struct field ordering for memory optimization
revive:
rules:
- name: exported
severity: warning
disabled: false
- name: var-naming
severity: warning
disabled: false
- name: indent-error-flow
severity: warning
disabled: false
- name: error-return
severity: warning
disabled: false
- name: error-strings
severity: warning
disabled: false
- name: error-naming
severity: warning
disabled: false
gosec:
excludes:
- G104 # Allow unhandled errors in some cases (covered by errcheck)
gocyclo:
min-complexity: 15
gocritic:
enabled-tags:
- diagnostic
- style
- performance
disabled-checks:
- unnamedResult
- hugeParam
- rangeValCopy
stylecheck:
checks: ["all", "-ST1000", "-ST1003"]
errorlint:
errorf: true
asserts: true
comparison: true
issues:
# Maximum issues count per one linter
max-issues-per-linter: 0
# Maximum count of issues with the same text
max-same-issues: 0
# Exclude specific issues by text
exclude-rules:
# Exclude some linters from running on tests files
- path: _test\.go
linters:
- gocyclo
- gosec
- errcheck
- gocritic
# Exclude some staticcheck messages
- linters:
- staticcheck
text: "SA9003:"
# Exclude lll issues for long lines with go:generate
- linters:
- lll
source: "^//go:generate "
output:
formats:
- format: colored-line-number
print-issued-lines: true
print-linter-name: true
sort-results: true