cpd (Rust) v5.0.10
Bug Fixes
- Emit scan-root-relative paths in all reporters when
absolute: false(or the default). Previously,jscpd /abs/pathfrom a different CWD left absolute paths in SARIF/JSON/XML/HTML/CSV/Markdown/console output, and Windows/macOS path canonicalization could leave\\?\or./prefixes. Paths are now normalized against the canonicalized scan root (with CWD fallback) and stripped of any leading./or.\\component. Fixes #827 - Fix
--skip-localto match jscpd v4 TypeScript semantics: it now filters clones where both fragments are under the same scan root, instead of only skipping clones in the same parent directory
Refactoring
- DRY duplication in reporters: extract shared helpers (
print_clone_header,print_clone_locations,print_snippet,write_report_file, report statistics, test fixtures, etc.) intocpd-reporter/src/shared.rs. Console, console-full, CSV, JSON, HTML, Markdown, silent, XML, and SARIF reporters now reuse the same implementation, reducing the monorepo's reported duplication ratio from 5.0% to 0.56% and fixing a latent--absolutepath relativization bug in the same pass - Move blame enrichment from
gitoxidetogit blame --porcelain; capture elapsed time after blame so timing includes blame work - Resolve
needless_borrowclippy warnings in CSV and Markdown reporters
Documentation
- Add Nix and Homebrew install instructions to Rust READMEs. #818
- Update project homepage URLs to
https://jscpd.devin allCargo.tomland npmpackage.jsonfiles, add curl install method to READMEs, clean up outdated badges - Remove defunct Universal Analytics tracking pixels from all READMEs
Published Packages
cpd-core@0.1.5on crates.iocpd-finder@0.1.8on crates.iocpd-reporter@0.1.7on crates.iocpd-tokenizer@0.1.6on crates.iojscpd@5.0.10on crates.iocpd@5.0.10on npmjscpd@5.0.10on npmcpd-darwin-arm64@5.0.10on npmcpd-darwin-x64@5.0.10on npmcpd-linux-x64-gnu@5.0.10on npmcpd-linux-arm64-gnu@5.0.10on npmcpd-linux-x64-musl@5.0.10on npmcpd-windows-x64-msvc@5.0.10on npm
Install
npm install -g cpd
# or
npm install -g jscpd
# or
cargo install jscpd