mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 07:04:25 +00:00
models
This commit is contained in:
parent
18f723480f
commit
a20a72cd2e
2 changed files with 69 additions and 3 deletions
|
|
@ -12,7 +12,22 @@ echo "Running checks on staged files..."
|
|||
|
||||
run_checks() {
|
||||
# shellcheck disable=SC2086 # intentionally preserving word splitting for file list
|
||||
npx -y @biomejs/biome check --write --error-on-warnings $1
|
||||
CHECK_OUTPUT=""
|
||||
CHECK_STATUS=0
|
||||
set +e
|
||||
CHECK_OUTPUT="$(npx -y @biomejs/biome check --write --error-on-warnings "$1" 2>&1)"
|
||||
CHECK_STATUS=$?
|
||||
set -e
|
||||
|
||||
if [ "$CHECK_STATUS" -ne 0 ]; then
|
||||
if printf '%s\n' "$CHECK_OUTPUT" | grep -Fq "No files were processed in the specified paths."; then
|
||||
return 0
|
||||
fi
|
||||
echo "$CHECK_OUTPUT"
|
||||
return "$CHECK_STATUS"
|
||||
fi
|
||||
|
||||
[ -n "$CHECK_OUTPUT" ] && echo "$CHECK_OUTPUT"
|
||||
}
|
||||
|
||||
# Run Biome only when staged files include style targets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue