blob: 4fe9fa632f56ded073c21c1481af8c5020abe106 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# Node.js Validator
A zero-dependency Node.js CLI tool for validating `.gitinfo` files.
## Requirements
- Node.js 14+
## Usage
```bash
# Validate .gitinfo in current directory
node validate.js
# Validate a specific file
node validate.js path/to/.gitinfo
```
## Features
- Parses JSONC (strips `//` and `/* */` comments)
- 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
## Example Output
```
✓ .gitinfo is valid
```
```
Validation failed for .gitinfo:
- .root: invalid URI "not-a-url"
- root: unknown property "invalid_field"
```
|