Skip to content

Changelog

Alpha-normalization now detects renamed-variable clones by default. Local identifiers (params, receiver, body variables, closures) are canonicalized to v0/v1/... before hashing, so functions with identical structure but different variable names are detected.

  • Semantic (default) — alpha-normalized, finds Type 2 renamed clones
  • Exact — verbatim name matching, Type 1 copy-paste only
  • Structural — AST shape only, loosest matching

A single Config.DetectionMode enum replaces former boolean flags.

syntax.Serialize now shallow-copies each node before writing Type/Owns, so the original tree is never mutated and serialization is idempotent. The Type-1-vs-Type-2 distinction is preserved for statement-rooted fragments.

Deep-cloning before cache storage prevents data races. singleflight.Group deduplicates concurrent parses of byte-identical files. Parallel incremental parsing with worker pool is race-free.

serial() fingerprints entire statement subtrees into single composite tokens. This means the threshold counts duplicated statements, not arbitrary AST nodes. ValueSpec and TypeSpec declarations are each fingerprinted as single tokens.

See the GitHub Releases page for the complete version history.

art-dupl is a fork of mibk/dupl (via golangci/dupl) with major enhancements including multi-method detection, semantic matching, 7 output formats, templ support, generated-code filtering, incremental analysis, CI baseline gating, and a programmatic SDK.