Configuration
Configuration File
Section titled “Configuration File”Create a JSON configuration file (e.g., dupl.json) in your project root:
{ "threshold": 10, "outputFormat": "json", "paths": ["./src", "./internal"], "detectionMode": "semantic", "sortBy": "size", "includeVendor": false}art-dupl -c dupl.json# orart-dupl --config dupl.jsonPrecedence
Section titled “Precedence”- CLI flags (highest priority)
- Config file
- Built-in defaults (lowest)
Key Options
Section titled “Key Options”| Option | Type | Default | Description |
|---|---|---|---|
threshold |
int | 5 |
Minimum duplicated statements to report |
testThreshold |
int | 0 |
Separate threshold for test files (0 = max(30, threshold)) |
outputFormat |
string | "text" |
Output format: text, json, plumbing, html, sarif, simple-json |
detectionMode |
string | "semantic" |
Matching mode: semantic, exact, structural |
detectionMethods |
[]string | ["art-dupl"] |
Detection method(s): art-dupl, hash |
sortBy |
string | "size" |
Sort order: size, occurrence, hash, total-tokens |
paths |
[]string | ["."] |
Paths to scan |
includeVendor |
bool | false |
Include vendor directory |
workers |
int | 0 |
Parallel workers (0 = auto) |
incremental |
bool | false |
Enable AST caching |
cacheDir |
string | "" |
Cache directory (default: .cache/art-dupl) |
maxCacheEntries |
int | 0 |
Max cache entries (0 = unlimited) |
timeout |
duration | 0 |
Execution timeout (e.g., 30m); 0 disables timeout |
suppressTestLow |
bool | true |
Suppress low-priority clones in test files |
ignoreTests |
bool | false |
Exclude *_test.go files entirely |
includeTests |
bool | false |
Override all test-specific filtering |
minLines |
int | 0 |
Suppress clone groups spanning fewer than N source lines |
quiet |
bool | false |
Suppress non-essential status output |
Output Directory and All Formats
Section titled “Output Directory and All Formats”The --output-dir and --all flags are CLI-only. Use them together to generate every output format to a directory:
art-dupl --all --output-dir ./reportsDiff Visualization
Section titled “Diff Visualization”Enable diff visualization for HTML output via the CLI flag or JSON config:
{ "diffMode": "side-by-side"}Options: "side-by-side", "inline", "true" (defaults to side-by-side).
Reflection-Based Merging
Section titled “Reflection-Based Merging”Configuration merging is reflection-based — adding new Config fields requires no merge code changes. All fields with matching JSON tags are automatically merged from the config file.