Contributing
indycheck is open source and contributions are welcome — bug reports, rule corrections, new bindings, docs and examples.
Before you start
Section titled “Before you start”- Discuss first for big changes. Open an issue describing what you want to change before writing a lot of code — especially for new validators or new language bindings.
- Never use real personal data. Test values in issues, PRs and tests must be synthetic (like
AAAPL1234Cor234567890124). Never paste a real person’s PAN, Aadhaar, GSTIN or mobile number anywhere in the repo. - One Rust core. All validation rules live in the Rust crate. Language bindings are thin wrappers — do not re-implement rules in JavaScript or Python.
How to contribute
Section titled “How to contribute”- Fork the repo and clone your fork.
- Create a branch:
git checkout -b fix/pan-holder-typeorgit checkout -b docs/hindi-errors. - Make your change, with tests.
- Run the checks (see below) and make sure everything passes.
- Open a pull request against
main, describing what changed and why, with before/after examples.
Rules for validation changes
Section titled “Rules for validation changes”- Every rule change needs a test with a valid and an invalid example, plus the official source for the rule (e.g. UIDAI’s Verhoeff note, the GSTN check-digit algorithm, RBI’s IFSC format).
- Error
codevalues are a public API — never rename or remove one without a major-version discussion. Add new codes instead. - Every failure path must produce both
reason_enandreason_hi. - Keep the result shape identical across JS, Python and Rust.
Running the checks
Section titled “Running the checks”# Rust core + all testscargo test
# JavaScript binding (Node 18+)cd packages/indycheck-js && npm install && npm test
# Python binding (Python 3.9+)cd packages/indycheck-py && pip install -e . && pytest
# This websitecd website && npm install && npm run buildDocs contributions
Section titled “Docs contributions”Docs live in website/src/content/docs/ (English for v0.2.0) and the landing/playground pages in website/src/pages/. Every doc page should have: real valid + invalid examples, a code sample in at least JavaScript, and the honest-limits note. Check your change with npm run build in website/.
Code style
Section titled “Code style”- Rust:
cargo fmtandcargo clippyclean. - JavaScript/TypeScript: 2-space indent, single quotes, semicolons (see
.prettierrc). - Keep functions small and pure — validators take a string and return a result; no I/O, no globals, no network.
Reporting a bug
Section titled “Reporting a bug”Open an issue with:
- The validator and the exact input (synthetic data only).
- What indycheck returned (
ok,code). - What you expected, and the official source for the rule.
- Your environment: package version, language, OS.
Security issues (for example, a validation bypass with real-world impact): please open a GitHub issue marked security rather than posting a public proof of concept.