SpectralOps / spectral-pre-commit

Spectral pre-commit.com Hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Spectral pre-commit Integration

This is a repo with Spectral hooks for pre-commit

Usage

To use Spectral you need an active Spectral account. If you don't have one yet, grab a free trial!

If you want to add Spectral to your Git pre-commit hooks and you're using pre-commit:

  1. Add the following to your .pre-commit-config.yaml:
    repos:
    -   repo: https://github.com/spectralops/spectral-pre-commit
        rev: master
        hooks:
        - id: spectral
  2. Run pre-commit install to install Spectral as a pre-commit hook for your repo.
  3. Make sure you have the spectral executable in your PATH.
  4. Make sure you have your Spectral DSN (spk-xxx) as an env var.

See spectralops/spectral-example-pre-commit for a live example.

About

Spectral pre-commit.com Hooks