Skip to main content

Python library to lint .gitlab-ci.yml files

Project description

gitlabci-jsonschema-lint

This is a pre-commit hook that uses the json schema from https://json.schemastore.org/gitlab-ci to validate the contents of your .gitlab-ci.yml file.

Rationale

Other similar tool exist like this hook but since the beginning of 2021, Gitlab updated their API and it is no longer possible to make unauthenticated calls to the Gitlab endpoint /api/v4/ci/lint that is used by the hook, and which makes it harder to integrate as it would require some shared token.

As an alternative to that, I created this hook which works completely offline

CLI Usage

gitlabci-jsonschema-lint ../some_projects/.gitlab-ci.yml

Pre-commit integration

An example .pre-commit-config.yaml:

repos:
  - repo: https://github.com/bagerard/gitlabci-jsonschema-lint
    rev: master
    hooks:
      - id: gitlabci-jsonschema-lint

Project details


Download files

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

Source Distribution

gitlabci-jsonschema-lint-0.0.3.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

gitlabci_jsonschema_lint-0.0.3-py2.py3-none-any.whl (14.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file gitlabci-jsonschema-lint-0.0.3.tar.gz.

File metadata

  • Download URL: gitlabci-jsonschema-lint-0.0.3.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for gitlabci-jsonschema-lint-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ec5ef51ce0b691de26b6e15fb716042cb5b3fbd53cf2d9d5f0cc6e6d7955957e
MD5 1ebee3b133254fb5f8e55da7db26038a
BLAKE2b-256 598274004fe835bdebd88786db596e9e6a060e136c0aae81a77ca4450dcd1814

See more details on using hashes here.

File details

Details for the file gitlabci_jsonschema_lint-0.0.3-py2.py3-none-any.whl.

File metadata

  • Download URL: gitlabci_jsonschema_lint-0.0.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

File hashes

Hashes for gitlabci_jsonschema_lint-0.0.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 0d938b1d5aa2f7b2a110b4c662a1552f1c9a951f58a3bf730fe10b400b633339
MD5 db9cc1dded36fdebe6190663fa015a5d
BLAKE2b-256 716c35db0338e07c49e9399564dd4635bf111d9d183e6a19fd674bdf0d8b9791

See more details on using hashes here.

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