SpectralOps / spectral-pre-commit

Spectral pre-commit.com Hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pre-commit hook expects Spectral binary in specific path, contrary to what README.md says

Nirusu opened this issue · comments

The README.md for the Spectral pre-commit hooks mentions the following requirement:

Make sure you have the spectral executable in your PATH.

This is not what this pre-commit hook is doing.

The pre-commit hook is specifically expecting the Spectral binary to be located in:
$HOME/.spectral/spectral

entry: bash -c '$HOME/.spectral/spectral scan --unstaged'

In my case, I have the binary in

➜  ~ whereis spectral
spectral: /opt/homebrew/bin/spectral

(which is definitely in my PATH and installed via Homebrew, just like the documentation suggests it) and the pre-commit hook fails since it doesn't find the binary:

spectral scanner.........................................................Failed
- hook id: spectral
- exit code: 127

/bin/bash: /Users/nils/.spectral/spectral: No such file or directory

System information in case needed is:
macOS Sonoma 14.1 (arm64)
MacBook Pro with M1 SoC

PS: Can we also get a arm64 binary soon, please? I think Spectral currently is the only development related tool I have installed locally for which Rosetta is still required.