https://github.com/kdablabs/qt_precommit
pre-commit hooks for Qt tools.
https://github.com/kdablabs/qt_precommit
pre-commit-hook qt
Last synced: 22 days ago
JSON representation
pre-commit hooks for Qt tools.
- Host: GitHub
- URL: https://github.com/kdablabs/qt_precommit
- Owner: KDABLabs
- License: mit
- Created: 2025-03-31T14:06:40.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-31T15:01:49.000Z (about 1 year ago)
- Last Synced: 2025-08-16T17:02:10.978Z (10 months ago)
- Topics: pre-commit-hook, qt
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 30
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# qt_precommit
[pre-commit](https://pre-commit.com/) hooks for Qt tools.
Currently supported hooks:
- [qmlformat](https://doc.qt.io/qt-6/qtqml-tooling-qmlformat.html): Formats QML files according to
the QML Coding Conventions;
- [qmllint](https://doc.qt.io/qt-6/qtqml-tooling-qmllint.html): QML syntax verifier and analyzer;
## Installing hooks
Add the following to your `.pre-commit-config.yaml`:
```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:
```ini
[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) license.
Contact KDAB at info@kdab.com if you need different licensing options.