diff options
| author | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 15:41:49 +0000 |
|---|---|---|
| committer | Alex Pooley (@zuedev) <zuedev@gmail.com> | 2026-02-05 15:41:49 +0000 |
| commit | 7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0 (patch) | |
| tree | c8ae7dd116d5f04ee5920a09fd574b40c97e4ca0 | |
| parent | 783c958aedfc2e538368e242b3f4c7b9dc2dbe54 (diff) | |
| download | gitinfo-7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0.tar gitinfo-7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0.tar.gz gitinfo-7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0.tar.bz2 gitinfo-7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0.tar.xz gitinfo-7dc44f1b304fea28f8df74f7d9339f92a4dc0ab0.zip | |
add validation rules
| -rw-r--r-- | README.md | 13 | ||||
| -rw-r--r-- | gitinfo.schema.json | 3 |
2 files changed, 15 insertions, 1 deletions
@@ -54,3 +54,16 @@ All keys are optional. Include only the fields relevant to your project. - `mirrors`: A list of URLs representing mirror repositories. - `maintainers`: A list of maintainers or contributors to the repository, provided as a 2D array with names and email addresses in the format `[[name, email], ...]`. We recommend using this field instead of traditional Git author/committer metadata for better clarity on who is responsible for the repository. - `license`: The license under which the repository is distributed (e.g., MIT, GPL-3.0). We recommend using the short identifier from [SPDX License List](https://spdx.org/licenses/) for consistency. + +### Validation Rules + +| Field | Format | Example | +| --------------- | ---------------------------- | ------------------------------------------------------------- | +| `root` | Valid URI (http/https) | `https://github.com/user/repo` | +| `gitmail` | Valid email address | `patches@example.com` | +| `icon` | URL (http/https) or data URI | `https://example.com/icon.png` or `data:image/png;base64,...` | +| `mirrors[]` | Valid URI (http/https) | `https://gitlab.com/user/repo` | +| `maintainers[]` | Tuple of `[name, email]` | `["Alice", "alice@example.com"]` | +| `tags[]` | Non-empty string | `"cli"` | +| `description` | String | Any text | +| `license` | SPDX identifier | `MIT`, `GPL-3.0`, `Apache-2.0` | diff --git a/gitinfo.schema.json b/gitinfo.schema.json index 7aac4d5..de19a23 100644 --- a/gitinfo.schema.json +++ b/gitinfo.schema.json @@ -27,7 +27,8 @@ "tags": { "type": "array", "items": { - "type": "string" + "type": "string", + "minLength": 1 }, "description": "A list of tags or keywords associated with the repository for easier categorization and searchability." }, |
