-
Notifications
You must be signed in to change notification settings - Fork 971
Description
We use pre-commit to ensure that our code is linted before committing.
We have noticed that pre-commit hangs when it goes to run this check.
I wanted to run openspec validate there
repos:
- repo: local
hooks:
- id: openspec-validate
name: Validate OpenSpec
language: script
entry: openspec
args:
- "validate"
- "--specs"
- "--strict"
- "--no-interactive"
pass_filenames: false
files: ^openspec/specs/
For some reason this hook just hangs. Running the command locally works - as does wrapping the call in a separate script:
#!/bin/sh
set -e
# Disable any potential interactive features
export CI=true
export OPENSPEC_NO_INTERACTIVE=1
# Close stdin and exec
exec openspec validate --specs --strict --no-interactive 0<&-
I've created a repo to help test this out:
https://github.com/greenkiwi/openspec-pre-commit-hook-issue
It has all the files and hooks.
Metadata
Metadata
Assignees
Labels
No labels