codeql/misc/scripts/pre-commit

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 строки
359 B
Plaintext
Исходник Обычный вид История

#!/bin/bash
exec 1>&2
exitVal=0
while read -r f
do
filename="${f##*/}"
extension="${filename##*.}"
p="$PWD/$f";
if [[ -f "$p" ]] && { [ "$extension" == "ql" ] || [ "$extension" == "qll" ]; }
then
if ! codeql query format --check-only "$p"
then
exitVal=1
fi
fi
done <<<"$(git diff --cached --relative --name-only)"
exit $exitVal