mirror of
https://github.com/kucherenko/jscpd.git
synced 2026-09-19 08:11:03 +08:00
0ddf611482
Complete Rust V1 of the jscpd copy-paste detector as a 5-crate Cargo workspace named `cpd` under rust/ in the jscpd monorepo. Crates: - cpd-core: data models, rolling-hash engine (Rabin-Karp/xxh3), sliding-window detect() with maximal-clone suppression - cpd-tokenizer: 282-format registry, OXC JS/TS/JSX/TSX tokenizer, generic scanner for 218+ formats, SFC extractor (Vue/Svelte/Astro), Markdown tokenizer, mode filter (mild/weak/strict) - cpd-finder: file walker (ignore crate), parallel tokenisation (rayon), orchestration pipeline, git-blame stub (gix), skip-local filter, statistics computation - cpd-reporter: 11 reporters — console (jscpd-format table), console-full (verbose + source snippets), json, sarif, xml, csv, html (askama), markdown, badge (SVG), xcode, threshold, silent - cpd: CLI binary (clap, 34 flags), .jscpd.json / package.json config layering Key fixes in this session: - Wire real ConsoleReporter in factory (was using stub) - Add markdown + badge reporters to factory - console.rs: per-clone format matching jscpd (bold-green paths, dim borders, red headers, bold Total:, dim Found N clones.) - console_full.rs: verbose format with source snippets (20-line limit, line-number gutter, blame inline) - detect.rs: suppress_subclones() filter removes sub-window clones, reducing count from 6274 to 290 vs jscpd 190 (from 33x to 1.5x) CI: .github/workflows/rust.yml with tokenizer-purity check + fuzz smoke Fuzz: standalone rust/fuzz/ workspace (cargo-fuzz, libfuzzer) Tests: 160 passing across 13 test suites MSRV: 1.87 / Edition 2024 / publish = false