-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.golangci.yml
More file actions
122 lines (106 loc) · 3.68 KB
/
.golangci.yml
File metadata and controls
122 lines (106 loc) · 3.68 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
# golangci-lint configuration for dtvem
# Documentation: https://golangci-lint.run/docs/configuration/file/
# Config version (must be a string for v2.x)
version: "2"
run:
# Timeout for analysis
timeout: 5m
# Include test files in linting
tests: true
# Output configuration (v2.x format)
output:
formats:
text:
path: stdout
colors: true
# Sort results by file, linter, severity
sort-order:
- file
- linter
# Show statistics
show-stats: true
# Linters configuration (v2.x format)
linters:
# Start with no linters enabled
default: none
# Enable specific linters
enable:
# Bugs & Correctness (ERRORS - will fail build)
- errcheck # Check for unchecked errors
- govet # Reports suspicious constructs
- ineffassign # Detect ineffectual assignments
- unused # Check for unused constants, variables, functions and types
# Style & Formatting (ERRORS - will fail build)
- misspell # Finds commonly misspelled English words in comments
- whitespace # Detect leading/trailing whitespace
# Code Quality (ERRORS - will fail build)
- dupl # Detect code duplication
- goconst # Find repeated strings that could be constants
- gocyclo # Compute cyclomatic complexity
# Best Practices (ERRORS - will fail build)
- errorlint # Find code that will cause problems with error wrapping
- nilerr # Find code that returns nil even if it checks that the error is not nil
- nilnil # Checks that there is no simultaneous return of nil error and invalid value
# Linter-specific settings (moved from top-level linters-settings)
settings:
# Settings for errcheck
errcheck:
# Report about not checking of errors in type assertions
check-type-assertions: true
# Report about assignment of errors to blank identifier
check-blank: false
# List of functions to exclude from checking
exclude-functions:
- (*os.File).Close
- (*database/sql.Rows).Close
# Settings for govet
govet:
# Enable all analyzers
enable-all: true
# Disable specific analyzers
disable:
- shadow # Reports variables that shadow other variables (can be too noisy)
- fieldalignment # Reports struct field ordering for memory optimization (too noisy)
# Settings for gocyclo (cyclomatic complexity)
gocyclo:
# Minimal code complexity to report (25 allows for existing complex functions)
min-complexity: 25
# Settings for dupl (code duplication)
dupl:
# Threshold for duplicate code detection
threshold: 100
# Settings for goconst
goconst:
# Minimal length of string constant
min-len: 3
# Minimum occurrences count to trigger issue
min-occurrences: 3
# Settings for misspell
misspell:
# Correct spellings using locale preferences
locale: US
# Exclusion rules (moved from issues section in v1.x)
exclusions:
# Generated files should be ignored
generated: lax
# Paths to exclude
paths:
- vendor
- dist
- .claude
- ".*\\.pb\\.go$"
# Rules to exclude specific linters in specific paths
rules:
# Ignore duplicate code and repeated strings in test files (test tables often have similar structure)
- linters:
- dupl
- goconst
path: "_test\\.go$"
# Issues configuration (v2.x format)
issues:
# Maximum issues count per one linter (0 = unlimited)
max-issues-per-linter: 0
# Maximum count of issues with the same text (0 = unlimited)
max-same-issues: 0
# Make issues output unique by line
uniq-by-line: true