Skip to content

Linting json

check-jsonschema

Buildin schemas

  • Builtin schemas
  • see also src/check_jsonschema/builtin_schemas
  • The '--builtin-schema' flag supports the following schema names:
    • vendor.azure-pipelines
    • vendor.bamboo-spec
    • vendor.bitbucket-pipelines
    • vendor.buildkite
    • vendor.circle-ci
    • vendor.cloudbuild
    • vendor.dependabot
    • vendor.drone-ci
    • vendor.github-actions
    • vendor.github-workflows
    • vendor.gitlab-ci
    • vendor.readthedocs
    • vendor.renovate
    • vendor.taskfile
    • vendor.travis
    • vendor.woodpecker-ci
    • custom.github-workflows-require-timeout

Here the most interesting:

  • gitlab-ci - Validate GitLab CI config against the schema provided by SchemaStore
  • github-actions
  • github-workflows
  • readthedocs
  • renovate

Install

sudo pacman -S check-jsonschema

cli usage

Docs: CLI usage

Builtin schema:

check-jsonschema --builtin-schema vendor.gitlab-ci .gitlab-ci.yml

Schema URL:

check-jsonschema -v \
  --schemafile https://raw.githubusercontent.com/goss-org/goss/master/docs/schema.yaml \
  goss.yaml

remote schemas

pre-commit usage

Usage in pre-commit:

.pre-commit-hooks.yaml

repos:
  - repo: https://github.com/python-jsonschema/check-jsonschema
    rev: 0.23.2
    hooks:
      - id: check-gitlab-ci

Different jsonlint linters