aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorSemih Yavuz <semih.yavuz@qt.io>2024-12-04 11:20:09 +0100
committerSemih Yavuz <semih.yavuz@qt.io>2025-02-10 20:00:05 +0100
commit7710e630c0e173fd95d50c4fac0f776e589dcd36 (patch)
tree2c0598b388ca0099db5b75bd175d9688b6a57c27 /tools
parentfe682237a646bafb2c1cbe5d6fd225fbf9ec0fe9 (diff)
qmlformat: fix error message output
We don't need m_valid to check if there is an error. Do validity check by m_error.isEmpty(). Prior to this commit, an invalid command line option given to qmlformat wouldn't spit out the error message and qmlformat would silently ignore the error and run with default settings. For example, the command qmlformat -W -342523 <filepath> should error out with this commit since a negative line length is given. Pick-to: 6.8 Change-Id: Ie7d07e3b2b3714793f9abed4558003cc5ad77b34 Reviewed-by: Sami Shalayel <sami.shalayel@qt.io> (cherry picked from commit f3a6026d11c9d7e9ec839aa2467364f09e35a025) Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tools')
-rw-r--r--tools/qmlformat/qmlformat.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/tools/qmlformat/qmlformat.cpp b/tools/qmlformat/qmlformat.cpp
index e960072322..d4fb5b9e53 100644
--- a/tools/qmlformat/qmlformat.cpp
+++ b/tools/qmlformat/qmlformat.cpp
@@ -186,7 +186,6 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app)
if (parser.isSet(writeDefaultsOption)) {
QQmlFormatOptions options;
options.setWriteDefaultSettingsEnabled(true);
- options.setIsValid(true);
return options;
}
@@ -223,7 +222,6 @@ QQmlFormatOptions buildCommandLineOptions(const QCoreApplication &app)
options.setNormalizeEnabled(parser.isSet("normalize"));
options.setObjectsSpacing(parser.isSet("objects-spacing"));
options.setFunctionsSpacing(parser.isSet("functions-spacing"));
- options.setIsValid(true);
options.setIndentWidth(indentWidth);
options.setIndentWidthSet(parser.isSet("indent-width"));