mirror of
https://github.com/ben-grande/qusal.git
synced 2025-05-06 08:15:32 -04:00
perf: make pre-commit hooks pass file extensions
- shell-lint: faster evaluation of shell scripts, hook 40% faster; - *-lint: unify method to find the "find" utility; and - pre-commit: pass file extensions to lint tools.
This commit is contained in:
parent
00a0b0f264
commit
35fa43dadf
11 changed files with 65 additions and 82 deletions
|
@ -7,17 +7,11 @@
|
|||
# shellcheck disable=SC2086
|
||||
set -eu
|
||||
|
||||
command -v git >/dev/null ||
|
||||
{ printf "Missing program: git\n" >&2; exit 1; }
|
||||
command -v git >/dev/null || { echo "Missing program: git" >&2; exit 1; }
|
||||
cd "$(git rev-parse --show-toplevel)" || exit 1
|
||||
./scripts/requires-program.sh pylint
|
||||
|
||||
find_tool="find"
|
||||
if command -v fd; then
|
||||
find_tool="fd"
|
||||
elif command -v fdfind >/dev/null; then
|
||||
find_tool="fdfind"
|
||||
fi
|
||||
find_tool="$(./scripts/best-program.sh fd fdfind find)"
|
||||
|
||||
if test -n "${1-}"; then
|
||||
files=""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue