A Rust CLI tool for validating .gitinfo files.
- Rust 1.70+ (with Cargo)
cd validators/rust
cargo build --releaseThe binary will be at target/release/validate (or validate.exe on Windows).
# Validate .gitinfo in current directory
./target/release/validate
# Validate a specific file
./target/release/validate path/to/.gitinfoOr run directly with Cargo:
cargo run -- path/to/.gitinfo- Parses JSONC (strips
//and/* */comments) - Removes trailing commas (valid in JSONC, invalid in JSON)
- Validates against the gitinfo JSON Schema
- Checks types, formats (URI, email), and patterns
- Enforces
additionalProperties: false - Returns exit code 0 on success, 1 on failure
- Color-coded output (green for success, red for errors)
✓ .gitinfo is valid
Validation failed for .gitinfo:
- .root: invalid URI "not-a-url"
- root: unknown property "invalid_field"
serde/serde_json- JSON parsingjson_comments- JSONC comment strippingregex- Pattern matching for validation