4 Commits

Author SHA1 Message Date
unkinben c683858261 test: validate all metadata.yaml files against schema in pytest
ci/woodpecker/pr/build-fedora43 Pipeline was successful
ci/woodpecker/pr/build-fedora42 Pipeline was successful
ci/woodpecker/pr/build-fedora44 Pipeline was successful
ci/woodpecker/pr/build-almalinux9 Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline failed
ci/woodpecker/pr/build-almalinux8 Pipeline was successful
2026-05-17 11:41:50 +10:00
unkinben fbb3471a42 refactor: use make test in pre-commit hook 2026-05-17 11:40:59 +10:00
unkinben 451254447f feat: add pytest pre-commit hook and tests scaffold (issue #162)
- pyproject.toml with pytest>=8 in [dependency-groups.dev] so
  uv run --group dev pytest resolves without a global install
- tests/__init__.py and tests/conftest.py skeleton referencing issue #162
- pre-commit local hook runs pytest tests/ on Python file changes;
  exit code 5 (no tests collected) is treated as success so commits
  are not blocked while the test suite is being built out
2026-05-17 11:35:03 +10:00
unkinben be23a37c2e feat: JSON Schema validation for metadata.yaml as pre-commit hook
Adds schema/metadata.json (JSON Schema draft-07) as the authoritative
schema for all rpms/*/metadata.yaml files.  Key constraints:

- additionalProperties: false at both the top level and builds items,
  so unknown fields are rejected outright
- name allows dots (fixes neovim-glibc-2.17)
- github is optional (fixes claude-code, which has no GitHub repo)
- repository enum includes fedora/42, fedora/43, fedora/44
- dist_tag boolean field documented in schema

Pre-commit hook (check-jsonschema 0.37.2) runs against every file
matching ^rpms/[^/]+/metadata\.yaml$ on every commit.

Also fixes rpms/claude-code/metadata.yaml: removes the unknown
claude_ai field and normalises field order.
2026-05-17 11:14:35 +10:00
2 changed files with 0 additions and 1 deletions
-1
View File
@@ -47,7 +47,6 @@ repos:
name: Validate RPM package metadata
files: ^rpms/[^/]+/metadata\.yaml$
args: [--schemafile, schema/metadata.json]
language_version: python3.11
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.7