Add schema practices and a JSON Schema ecosystem profile

Ouverte
#85 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
46/100
Type d'issue
Fonctionnalité
Clarté
Plutôt claire
Activité
Active
Stack technique
json, python
Domaine
testing, tooling

Piste de recherche

Start with project_validator/rules.py to see how rule types are defined, then read tests/test_ecosystem_contract.py and the language profile implementation for the existing contract pattern. Add the JSON Schema profile and the four checks described in the issue; the fixtures should show that a well configured schema passes and a bare schema is reported appropriately. Keep --validate-data out of scope.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

Checks

New practices, each a rule type in project_validator/rules.py, first supplied by a JSON Schema profile:

Check Passes when
schema-declared every schema names its dialect ($schema) and has an $id; a dialect older than draft 2019-09 warns
schema-validation CI validates the instance documents against their schemas: check-jsonschema, ajv-cli, the jsonschema CLI, jv
schema-examples the schemas come with examples that CI validates: valid ones that must pass and invalid ones that must fail (e.g. examples/valid, examples/invalid, or a test suite)
schema-compatibility CI checks schema changes for breaking changes (json-schema-diff or an equivalent) (warning-level)

Profile

JSON Schema: recognised by intent only, never by plain .json files (#63): *.schema.json, or a top-level $schema naming json-schema.org. code-formatting: prettier or biome. Language practices (coverage, platform-matrix, ...) have no rule and report SKIP.

Later

An optional deep mode, --validate-data, could validate instances against their schemas itself, with jsonschema as an optional dependency like rich (see the Dependency Policy). It follows --build as a precedent and is not part of this issue.

Definition of done

As for language profiles: well_configured_json_schema and bare_json_schema fixtures held by tests/test_ecosystem_contract.py. data-wellformed (#84) already covers schemas that do not parse.

Langage dominant
Python
Étoiles
4
Forks
1
Merge moyen
10 h 41 min
PR mergées (30 j)
79

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de cpp-best-practices/project_validator

Toutes les issues de cpp-best-practices/project_validator

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.