diff options
| author | Semih Yavuz <semih.yavuz@qt.io> | 2025-08-11 22:28:47 +0200 |
|---|---|---|
| committer | Semih Yavuz <semih.yavuz@qt.io> | 2025-08-14 19:54:37 +0200 |
| commit | e3891d74590bcb9c0a81ff603ddc92ddaa7e7fc8 (patch) | |
| tree | 416ef9c7e59b0a5ba4dbd488a1818c172ad22c48 /tools/qmlformat/qmlformat.cpp | |
| parent | 141993c0a5b2a2b6ea244c6bee2ca3141b1a020a (diff) | |
qmltoolings add --dry-run option for qmlformat and qmllint
Add reportConfigForFiles to generic tooling class. It will perform the
search for the given files. Use stdout to report. qmllint had already an
option --dry-run for printing the fixed codes, but we can still allow this to
use that option name.
For qmlls, report the path if verbose option is set.
Fixes: QTBUG-137874
Change-Id: I6bd43866073b3df832b6fd89d477bced869d74c0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools/qmlformat/qmlformat.cpp')
| -rw-r--r-- | tools/qmlformat/qmlformat.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/qmlformat/qmlformat.cpp b/tools/qmlformat/qmlformat.cpp index 6cdfa907c3..786783a933 100644 --- a/tools/qmlformat/qmlformat.cpp +++ b/tools/qmlformat/qmlformat.cpp @@ -136,6 +136,11 @@ int main(int argc, char *argv[]) return -1; } + if (options.dryRun()) { + settings.reportConfigForFiles(options.arguments()); + return 0; + } + if (options.writeDefaultSettingsEnabled()) return settings.writeDefaults() ? 0 : -1; |
