Merge pull request #500 from ThatOneCalculator/devex/precommit

devex: precommit hook to run qmlfmt, parallelize `qmlfmt.sh`
This commit is contained in:
Lemmy
2025-10-16 16:34:24 -04:00
committed by GitHub
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 {}

View File

@@ -276,6 +276,7 @@ Item {
if (appId)
return appId
} catch (e) {
}
// Try direct properties
@@ -298,6 +299,7 @@ Item {
return String(ipcData.class || ipcData.initialClass || ipcData.appId || ipcData.wm_class || "")
}
} catch (e) {
}
return ""

4
lefthook.yml Normal file
View File

@@ -0,0 +1,4 @@
pre-commit:
jobs:
- name: format qml
run: ./Bin/dev/qmlfmt.sh && git update-index --again