The only standalone, multiplatform pre-commit hook for formatting QML files using the qmlformat
tool with no Qt prerequisites required.
-
Add this repository to your
.pre-commit-config.yaml
:- repo: https://github.com/tomas-krupa/qmlformat-hook.git rev: 1.0.0 hooks: - id: qmlformat files: '.*\.qml$' #args: ["--check"]
-
Install the pre-commit hooks:
pre-commit install
-
Make a commit with QML files to see the hook in action.