This is a repo with Spectral hooks for pre-commit
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:
- Add the following to your
.pre-commit-config.yaml
:repos: - repo: https://github.com/spectralops/spectral-pre-commit rev: master hooks: - id: spectral
- Run
pre-commit install
to install Spectral as a pre-commit hook for your repo. - Make sure you have the spectral executable in your PATH.
- Make sure you have your Spectral DSN (
spk-xxx
) as an env var.
See spectralops/spectral-example-pre-commit for a live example.