Skip to content

Commit 221d8b4

Browse files
committed
feat: add duplication linter (dupl) to golangci configuration
- Enable dupl linter to detect duplicate code fragments - Set threshold to 100 tokens (more sensitive than default 150) - Helps identify code that can be refactored to reduce duplication
1 parent 17dba8a commit 221d8b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.golangci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ linters:
1616
- unused
1717
- contextcheck
1818
- wsl_v5
19+
- dupl
1920

2021
disable:
2122
- cyclop # Too strict
@@ -49,6 +50,9 @@ linters:
4950
excludes:
5051
- G204 # Subprocess launched with variable - inputs are validated and sanitized
5152
- G304 # Potential file inclusion via variable - path is validated and comes from trusted config
53+
dupl:
54+
# Set threshold for duplicate code detection (default is 150 tokens)
55+
threshold: 100
5256

5357
formatters:
5458
enable:

0 commit comments

Comments
 (0)