-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path.golangci.yaml
82 lines (71 loc) · 3.25 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
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
# This is a golangci-lint config file for Clipper CI workflows
# For more details on configuring golangci-lint, visit: https://golangci-lint.run/usage/configuration/
# Special thanks to @ccoVeille for the original configuration
run:
# Timeout for golangci-lint execution
timeout: 5m
# Additional parameters to ensure all files are checked and caching is used
modules-download-mode: readonly
allow-parallel-runners: true
linters:
# Disable all linters initially
disable-all: true
# Enable specific linters with comments explaining each one
enable:
- errcheck # Checks for unchecked errors in Go code
- thelper # Detects Go test helpers without t.Helper() call
- unused # Checks for unused constants, variables, functions, and types
- unparam # Reports unused function parameters
- unconvert # Removes unnecessary type conversions
- whitespace # Detects leading and trailing whitespace
- ineffassign # Detects when assignments to existing variables are not used
- asasalint # Checks for passing []any as any in variadic func(...any)
- wastedassign # Finds wasted assignment statements
- misspell # Finds commonly misspelled English words in comments
- funlen # Detects long functions
- bodyclose # Checks whether HTTP response body is closed successfully
- reassign # Checks that package variables are not reassigned
- tagliatelle # Checks struct tags
- decorder # Checks declaration order and count of types, constants, variables, and functions
- revive # Fast, configurable, extensible linter for Go. Drop-in replacement for golint
- dupword # Checks for duplicate words in the source code
- cyclop # Checks function and package cyclomatic complexity
- gocognit # Computes and checks the cognitive complexity of functions
- goconst # Finds repeated strings that could be replaced by a constant
- gocritic # Provides diagnostics that check for bugs, performance, and style issues
- godot # Checks if comments end in a period
- godox # Detects FIXME, TODO, and other comment keywords
- errname # Checks that sentinel errors are prefixed with `Err` and error types are suffixed with `Error`
- varnamelen # Checks that the length of a variable's name matches its scope
- testpackage # Ensures use of a separate _test package
- gochecknoinits # Checks that no init functions are present in Go code
issues:
# Use default exclusions
exclude-use-default: true
# Set limits for reported issues
max-issues-per-linter: 0
max-same-issues: 0
severity:
# Severity levels for issues
error: true
warning: true
info: true
ignore: false
# Performance optimization settings
performance:
golangci-lint:
concurrency: 4
max-same-issues: 3
max-issues-per-linter: 10
# Caching settings to improve performance
caches:
enable: true
cache-dir: /tmp/golangci-lint-cache
# CI-specific settings
ci:
# Enable fail-fast to stop on the first failure
fail-fast: true
# Run golangci-lint as a pre-commit hook
pre-commit:
run: true
mode: diff