Contributing

Setup

Pure Rust: a Rust toolchain (1.88 or newer) is all you need, no C compiler or system libraries.

git clone https://github.com/ewels/FastQC-Rust.git
cd FastQC-Rust
cargo build --release
cargo test

Code quality

CI runs these on every pull request into main, plus the equivalence tests below and a build check on the minimum supported Rust version.

cargo fmt --check                          # Format check
cargo clippy --all-targets -- -D warnings  # Lint, zero warnings
cargo test                                 # Unit + integration tests
cargo audit                                # Dependency security audit

Equivalence tests

Output must stay byte-identical to Java FastQC. These tests compare Rust output against stored Java reference data for every CLI flag variation. Requires uv.

cargo build --release
uv run tests/equivalence/compare.py --binary ./target/release/fastqc

# A single test case
uv run tests/equivalence/compare.py --binary ./target/release/fastqc --test minimal_default

# Any two report directories
uv run tests/equivalence/compare.py --reference /path/to/java --actual /path/to/rust --output report.html

Writes an HTML report with text diffs and image comparisons to tests/equivalence/reports/equivalence_report.html. Test cases are defined in tests/equivalence/test_cases.yaml.

Code that does something non-idiomatic only to match Java's exact output, such as integer division or Java's number formatting, is marked with a // JAVA COMPAT comment.

Updating to a new upstream version

A nightly CI job opens an issue when Java FastQC publishes a new release. To update:

  1. Update the version in UPSTREAM.toml and in VERSION / VERSION_BANNER in src/lib.rs.
  2. Regenerate the reference data from the release zip (needs Java 11+), then the SVG patch files.
  3. Review the patch changes: only text and legend x-positions should differ.
  4. Port any upstream behaviour changes and run the equivalence tests until they pass.
gh release download vX.Y.Z -R s-andrews/FastQC -p 'fastqc_*.zip' && unzip fastqc_*.zip
bash tests/equivalence/generate_reference.sh ./FastQC
uv run tests/equivalence/update_svg_patches.py

Issues

Bugs and feature requests: GitHub Issues.