Skip to content

Files

Latest commit

69f52f3 · Mar 31, 2025

History

History
43 lines (29 loc) · 1.17 KB

README.md

File metadata and controls

43 lines (29 loc) · 1.17 KB

qt_precommit

pre-commit hooks for Qt tools.

Currently supported hooks:

  • qmlformat: Formats QML files according to the QML Coding Conventions;
  • qmllint: QML syntax verifier and analyzer;

Installing hooks

Add the following to your .pre-commit-config.yaml:

  - repo: https://github.com/KDABLabs/qt_precommit
    rev: v0.0.1
    hooks:
      - id: qmlformat
      - id: qmllint

Configuration

qt_precommit will check for a .qt-precommit file in the current working directory, for example:

[Qt]
path = /path/to/Qt/6.8.2/macos/bin

If the file does not exist, or the Qt path is not configured, qt_precommit will use the PATH environment variable when searching for the specified tool.

If used, the .qt-precommit file should be added to the .gitignore file, as this is a machine-specific configuration.

Licensing

qt_precommit is © Klarälvdalens Datakonsult AB (KDAB) and is made available under the terms of the MIT license.

Contact KDAB at info@kdab.com if you need different licensing options.