Thanks for considering a contribution! This document describes how to propose changes and what is required for a contribution to be accepted.
- Fork kucherenko/jscpd and clone your fork.
- Create a feature branch from
master. - Make your changes (see the workflows below).
- Open a pull request against
masterdescribing what the change does and why.
Bug reports and feature requests go through GitHub Issues. Security vulnerabilities must not be reported publicly — see SECURITY.md.
The repository contains two engines:
- Rust engine (v5, active development) in
rust/— thecpdbinary and its crates. - TypeScript packages (v4, maintenance) in
packages/andapps/— security and critical fixes only.
cd rust
cargo build
cargo test --workspace # full test suite
cargo clippy --workspace --all-targets -- -D warnings
cargo fmt --all # formatting is enforcedThe Rust test suite is not run in PR CI — run it locally before submitting.
pnpm install
pnpm dev # run in dev mode
pnpm test # test suite
pnpm build- Tests are required. New functionality must come with tests that exercise
it, and bug fixes should include a test that fails without the fix. As a
rule of thumb, look at the existing tests next to the code you touch
(
#[cfg(test)]modules andtests/directories in Rust,__tests__in TypeScript) and follow their patterns. - CI must be green. Lints and formatting are enforced:
cargo clippy -D warningsandcargo fmt --checkfor Rust, ESLint for TypeScript. - Match the surrounding style — naming, comment density, and idioms of the file you are editing.
- Keep changes focused. One logical change per pull request; unrelated refactoring belongs in its own PR.
- By submitting a contribution you agree that it is licensed under the project's MIT license.
All interactions are covered by the Code of Conduct.