This change adds support for a reading a simple settings file (.qmllint.ini) to set log levels and various other options.
The settings file applies on a per-directory basis so linting files in two subdirectories with different settings will use their respective settings files.
If the directory of the linted file does not contain any settings we search through all parent directories.
This is implemented in a way that qmlformat can also utilize the settings file code.
This makes qmllint more useful for larger projects that might want different settings for different parts of their QML code.
It also allows for better integration in CI checks and pre-commit hooks.
[ChangeLog][General][qmllint] Adds the ability to set linting options via a settings file rather than using command line parameters. Use --write-defaults to generate a template with default values for editing. Use --ignore-settings to disable this feature
Change-Id: I94e4a47916b5dfd16c3a69efdba3858235cab738
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Adds support for inline components for qmllint with a few things not working yet:
- Two inline components referencing each other
- Using inline components before they are declared
These two issues require a larger overhaul of qmllint as a whole and will be addressed in a different change.
Change-Id: I2834702c21a8eb728db4709d6f475c33796b3e4d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Add the ability to individually disable and set the severity of all warnings produced by qmllint.
Change-Id: I46081f8b37fb90f8d0f4a5f2f08223d7b7285041
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Import warnings will now always be clearly associated with the line and import that
caused them. They're also visually separated now and don't redundantly show the importing files name in every warning.
Some type of imports such as file or URI based imports never had their warnings processed which is also fixed by this change.
Change-Id: I63d720fcf198ff5302c2566a91cde4c716697f7e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Improves the logging situation greatly by allowing all logging messages to be assigned different severities,
highlighting the code that caused them and by now ensuring a qmllint warning will always result in a non-zero exit code.
A later patch will expose more of these options to the user.
Change-Id: Id9b036fe3ba80dd18e9f8cb1b05efa891713d5a8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>