Feature request: Vendor `pyproject.toml` and `.pre-commit-hooks.yaml` JSON schemas

Ouverte Adaptée aux débutants
#737 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
2/5
Temps estimé
1-3 heures
Accessibilité débutants
77/100
Type d'issue
Fonctionnalité
Clarté
Clairement spécifiée
Activité
Active
Stack technique
python, yaml
Domaine
cli, tooling

Piste de recherche

Examinez les hooks de schémas déjà intégrés au dépôt et la façon dont ce projet organise les fichiers de schémas. L’issue mentionne pyproject.toml et .pre-commit-hooks.yaml et contient des liens vers les deux schémas SchemaStore. Suivez le modèle des schémas similaires déjà intégrés au dépôt, puis exécutez les vérifications de validation pertinentes du projet. Le travail est terminé lorsque les deux schémas sont disponibles via le mécanisme existant du projet et valident les fichiers nommés.

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

Description

[!NOTE]

Hey, thanks for maintaining this project! This has become one of my go-to set of hooks across all my projects 😎

I'm not sure how to request vendored hooks, but other folks seems to have requested them via issue, so I'm doing the same 😄

Summary

Vendor SchemaStore JSON schemas for pyproject.toml and .pre-commit-hooks.yaml:

These fit nicely with this project as this project is using both pyproject.toml and .pre-commit-hooks.yaml, too!

Note: I did think about suggesting .pre-commit-config.yaml, but figured that didn't make sense since pre-commit validates its own configuration at runtime anyway.

Details

Similar issues

I couldn't find any other issues requesting these two schemas, so I think this is a new request.

Alternatives

I could find similar projects for validating the pyproject.toml file (e.g. abravalheri/validate-pyproject and henryiii/validate-pyproject-schema-store), but nothing for validating .pre-commit-hooks.yaml.

Even though I could use the alternatives for the pyproject.toml file, I'd like the convenience of using the same project for my schema validations (this project!).

Testing

I've been using the SchemaStore versions directly for a while now, and they've been working well. Here's something similar to my current pre-commit configuration for them for reference:

Expand for YAML configuration

  - repo: local
    hooks:
      - <<: &check-jsonschema-config
          entry: check-jsonschema
          pass_filenames: true
          language: python
          additional_dependencies: ["check-jsonschema==0.38.2"]
        id: check-pyproject
        name: Validate pyproject.toml schema
        files: pyproject.toml
        args: ["--schemafile", "https://json.schemastore.org/pyproject.json"]
      - <<: *check-jsonschema-config
        id: check-pre-commit-hooks
        name: Validate .pre-commit-hooks.yaml schema
        files: .pre-commit-hooks.yaml
        args: ["--schemafile", "https://json.schemastore.org/pre-commit-hooks.json"]

Contributing

I'd be happy to raise a PR for this (or two, one for each schema?) -- there are enough PRs for adding vendored schemas that I think I should be able to just follow what they do 💪

Langage dominant
Python
Étoiles
357
Forks
74
Merge moyen
8 j 14 h
PR mergées (30 j)
3

Préparer son environnement

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 python-jsonschema/check-jsonschema

Toutes les issues de python-jsonschema/check-jsonschema

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.