devex: precommit hook to run qmlfmt, parallelize qmlfmt.sh

This commit is contained in:
Kainoa Kanter
2025-10-16 13:28:11 -07:00
parent 04c2243a9d
commit d5b9abd9e0
3 changed files with 10 additions and 2 deletions

View File

@@ -4,4 +4,6 @@
# Can be installed from AUR "qmlfmt-git"
# Requires qt6-5compat
find . -name "*.qml" -print -exec qmlfmt -e -b 360 -t 2 -i 2 -w {} \;
cd "$(git rev-parse --show-toplevel)"
echo "Formatting $(find . -name "*.qml" | wc -l) files..."
find . -name "*.qml" -print0 | xargs -0 -P "$(nproc)" -I {} qmlfmt -e -b 360 -t 2 -i 2 -w {}