From 4a9cea1d843c0c5b51e0259e75640af26f898b18 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Mon, 17 Nov 2025 12:57:32 -0800 Subject: [PATCH 1/2] fix: only use qt6 qmlformat --- Bin/dev/qmlfmt.sh | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Bin/dev/qmlfmt.sh b/Bin/dev/qmlfmt.sh index 7b219092..806fa770 100755 --- a/Bin/dev/qmlfmt.sh +++ b/Bin/dev/qmlfmt.sh @@ -4,21 +4,15 @@ set -euo pipefail # QML Formatter Script # Find qmlformat binary -if command -v qmlformat &>/dev/null; then - QMLFORMAT="qmlformat" -elif [ -x "/usr/lib/qt6/bin/qmlformat" ]; then - QMLFORMAT="/usr/lib/qt6/bin/qmlformat" -elif [ -x "/usr/lib/qt5/bin/qmlformat" ]; then - QMLFORMAT="/usr/lib/qt5/bin/qmlformat" -else - echo "No 'qmlformat' found in PATH or /usr/lib/qt6/bin." >&2 - echo "Install it via 'qt6-declarative-tools' or 'qt5-declarative' (depending on your distro) to proceed." >&2 +if [ ! -x "/usr/lib/qt6/bin/qmlformat" ]; then + echo "No 'qmlformat' found in /usr/lib/qt6/bin." >&2 + echo "Install it via 'qt6-declarative-tools' to proceed." >&2 exit 1 fi -echo "Using 'qmlformat' for formatting: $QMLFORMAT" -export QMLFORMAT -format_file() { "$QMLFORMAT" -w 2 -W 360 -S --semicolon-rule always -i "$1" || { echo "Failed: $1" >&2; return 1; }; } +format_file() { + /usr/lib/qt6/bin/qmlformat -w 2 -W 360 -S --semicolon-rule always -i "$1" || { echo "Failed: $1" >&2; return 1; } +} export -f format_file @@ -29,4 +23,4 @@ mapfile -t all_files < <(find "${1:-.}" -name "*.qml" -type f) echo "Formatting ${#all_files[@]} files..." printf '%s\0' "${all_files[@]}" | \ xargs -0 -P "${QMLFMT_JOBS:-$(nproc)}" -I {} bash -c 'format_file "$@"' _ {} \ - && echo "Done" || { echo "Errors occurred" >&2; exit 1; } \ No newline at end of file + && echo "Done" || { echo "Errors occurred" >&2; exit 1; } From 63f140459812b01d39261671aea7908dc13d3406 Mon Sep 17 00:00:00 2001 From: Kainoa Kanter Date: Mon, 17 Nov 2025 12:59:02 -0800 Subject: [PATCH 2/2] package name --- Bin/dev/qmlfmt.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Bin/dev/qmlfmt.sh b/Bin/dev/qmlfmt.sh index 806fa770..7e12950c 100755 --- a/Bin/dev/qmlfmt.sh +++ b/Bin/dev/qmlfmt.sh @@ -6,7 +6,7 @@ set -euo pipefail # Find qmlformat binary if [ ! -x "/usr/lib/qt6/bin/qmlformat" ]; then echo "No 'qmlformat' found in /usr/lib/qt6/bin." >&2 - echo "Install it via 'qt6-declarative-tools' to proceed." >&2 + echo "Install it via 'qt6-tools' or 'qt6-declarative-tools' to proceed." >&2 exit 1 fi