Related Tools
Go-Specific
Section titled “Go-Specific”| Tool | Approach | Notes |
|---|---|---|
| dupl | Suffix tree | The original tool art-dupl is forked from |
| golangci/dupl | Suffix tree | golangci-lint’s fork of dupl |
| go-tools | Static analysis | Comprehensive Go static analysis (not clone-specific) |
Multi-Language
Section titled “Multi-Language”| Tool | Approach | Notes |
|---|---|---|
| jscpd | Token-based | Multi-language, not AST-aware |
| PMD CPD | Token-based | Java-focused, supports other languages |
| Sourcerer | AST-based | Commercial, multi-language |
How art-dupl Differs
Section titled “How art-dupl Differs”art-dupl combines:
- AST-level analysis (not text/token-based) — understands Go semantics
- Suffix tree algorithm — O(n) duplicate search with O(1) transitions
- Three matching modes — semantic, exact, structural
- Generated-code filtering — auto-detects 6 generator categories
- CI baseline gating — record accepted state, gate on new clones
- Templ support — full
.templAST analysis - 7 output formats — including SARIF for GitHub Security
- Programmatic SDK — embed in your own tools
Integration with golangci-lint
Section titled “Integration with golangci-lint”art-dupl is not currently integrated with golangci-lint. To use alongside it:
# Run golangci-lint for lintinggolangci-lint run
# Run art-dupl for clone detection separatelyart-dupl -t 15Or use the pre-commit hook to run art-dupl automatically.