Skip to main content

A pre-commit hook for validating files against jsonschemas.

Project description

check-jsonschema

A pre-commit hook for checking files against a JSONSchema. The schema may be specified as a local or remote (HTTP or HTTPS) file.

Remote files are automatically downloaded and cached if possible.

Validate GitHub Workflows with Schemastore

You can use the schemastore github workflow schema to lint your GitHub workflow files. This hook is so useful, it's built in as a pre-set. All you need to add to your .pre-commit-config.yaml is this:

- repo: https://github.com/sirosen/check-jsonschema
  rev: 0.2.0
  hooks:
    - id: check-github-workflows

Applying an arbitrary schema to files

There is a more general hook available for running any jsonschema against a file or set of files. For example, to implement the GitHub workflow check manually, you could do this:

- repo: https://github.com/sirosen/check-jsonschema
  rev: 0.2.0
  hooks:
    - id: check-jsonschema
      name: "Check GitHub Workflows"
      language: python
      files: ^\.github/workflows/
      types: [yaml]
      args: ["--schemafile", "https://json.schemastore.org/github-workflow"]

Standalone Usage

You can also pip install check-jsonschema to run the tool manually.

For full usage info:

check-jsonschema --help

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

check-jsonschema-0.2.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

check_jsonschema-0.2.0-py2.py3-none-any.whl (4.5 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file check-jsonschema-0.2.0.tar.gz.

File metadata

  • Download URL: check-jsonschema-0.2.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.9

File hashes

Hashes for check-jsonschema-0.2.0.tar.gz
Algorithm Hash digest
SHA256 2e330afb0c3375fc0b08708789fd12a8602cfb7d43683eb2286a147794ae8f27
MD5 32a796c2087a81129659990bfcbb913f
BLAKE2b-256 aac95541734b3974a48293289886f70825d78a011b443b1129b5a6aef2968e1c

See more details on using hashes here.

Provenance

File details

Details for the file check_jsonschema-0.2.0-py2.py3-none-any.whl.

File metadata

  • Download URL: check_jsonschema-0.2.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 4.5 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.6.9

File hashes

Hashes for check_jsonschema-0.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 a8f24b2ec8662c6961232d1c919242254a7af3f338e1c074791672cf0c8bca30
MD5 027f404c828bbe12cf2c915a780604ff
BLAKE2b-256 c0c3f46a33a56521b438ae04a231998763927bd5be4dddf9ece2b766041fc58d

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page