aboutsummaryrefslogtreecommitdiffstats
path: root/tools/qmllint/CMakeLists.txt
diff options
context:
space:
mode:
authorMaximilian Goldstein <max.goldstein@qt.io>2021-05-12 18:32:57 +0200
committerMaximilian Goldstein <max.goldstein@qt.io>2021-05-27 11:30:12 +0200
commit73d51eed2f669ac91f139af3d6a5bcc621dec64a (patch)
tree245f36c09ac67f0b87ca3f15e5f249595bfb9603 /tools/qmllint/CMakeLists.txt
parent769fa5f8fae7b40cf38de086dcac6b73b32364e8 (diff)
qmllint: Add support for loading options from settings
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>
Diffstat (limited to 'tools/qmllint/CMakeLists.txt')
-rw-r--r--tools/qmllint/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/qmllint/CMakeLists.txt b/tools/qmllint/CMakeLists.txt
index 77e22598f3..8e9a737f5a 100644
--- a/tools/qmllint/CMakeLists.txt
+++ b/tools/qmllint/CMakeLists.txt
@@ -12,6 +12,8 @@ qt_internal_add_tool(${target_name}
checkidentifiers.cpp checkidentifiers.h
findwarnings.cpp findwarnings.h
main.cpp
+ ../shared/qqmltoolingsettings.h
+ ../shared/qqmltoolingsettings.cpp
PUBLIC_LIBRARIES
Qt::CorePrivate
Qt::QmlCompilerPrivate