From d1fea725a4d65cf2fbbe6fe6b15c71e107e6f338 Mon Sep 17 00:00:00 2001 From: Jan Holthuis Date: Tue, 25 May 2021 14:28:10 +0200 Subject: [PATCH] pre-commit: Add hooks for qmlformat/qmllint --- .pre-commit-config.yaml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9d4c45d80a1..e7e32efce71 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -124,3 +124,23 @@ repos: stages: - commit - manual + - id: qmlformat + name: qmlformat + entry: qmlformat -i + pass_filenames: true + require_serial: true + language: system + types: [text] + files: ^.*\.qml$ + # Not enabled in commit stage by default, because qmlformat requires Qt + # 5.15 to be installed + stages: + - manual + - id: qmllint + name: qmllint + entry: qmllint + pass_filenames: true + require_serial: true + language: system + types: [text] + files: ^.*\.qml$