Contributing¶
Contributions to Amplirust are welcome!
Development Setup¶
# Clone the repository
git clone https://github.com/erdikilic/amplirust.git
cd amplirust
# Build
RUSTFLAGS="-C target-cpu=native" cargo build --release
# Run tests
cargo test
Code Quality¶
CI enforces a quality gate on every push and pull request. Before submitting changes, ensure your code passes all checks locally:
# Format code
cargo fmt --all
# Run linter (pedantic lints are configured in Cargo.toml)
cargo clippy --all-targets -- -D warnings
# Audit dependencies for security vulnerabilities and license issues
cargo deny check
# Run tests with both parser backends
cargo test
cargo test --no-default-features --features parser_needletail
Testing¶
Unit & integration tests¶
Fuzz testing¶
Requires a nightly toolchain and cargo-fuzz:
cargo install cargo-fuzz
# Run a target (runs until stopped with Ctrl-C)
cargo +nightly fuzz run fuzz_fasta
# Available targets: fuzz_fasta, fuzz_genbank_streaming, fuzz_genbank_slice,
# fuzz_primer_csv, fuzz_primer_matcher
cargo +nightly fuzz list
Mutation testing¶
Requires cargo-mutants:
Configuration is in .cargo/mutants.toml.
Benchmarks¶
Requires Criterion (already a dev-dependency):
# Run all benchmarks
cargo bench
# Run a specific suite
cargo bench --bench matching
cargo bench --bench parsing
cargo bench --bench pipeline
cargo bench --bench circular
Validation against UCSC isPCR¶
The script scripts/validate_ispcr.sh compares amplirust output against the gold-standard UCSC isPCR tool. It requires isPcr on your PATH and downloads the E. coli K-12 genome:
Feature Flags¶
Amplirust uses feature flags for FASTA parser selection:
parser_seqio(default) -- uses the seq_io parserparser_needletail-- uses the needletail parser
Test with both parsers when making changes to input handling:
Submitting Changes¶
- Fork the repository
- Create a feature branch (
git checkout -b feature/my-change) - Make your changes and add tests
- Ensure all CI checks pass:
cargo fmt --all,cargo clippy --all-targets -- -D warnings,cargo deny check, andcargo test(with both parser features) - Open a pull request against
main
License¶
Amplirust is licensed under the MIT License.