diff options
| author | Sami Shalayel <sami.shalayel@qt.io> | 2026-06-03 17:34:33 +0200 |
|---|---|---|
| committer | Sami Shalayel <sami.shalayel@qt.io> | 2026-07-01 11:55:22 +0000 |
| commit | 3357be27f3b3e383347484530ffa9ed570d66ddb (patch) | |
| tree | 6a41544c81fa82410a2aabc6347a787f06f81e69 /tools | |
| parent | 80137141e2806f884bd83bfae6104540181ab315 (diff) | |
qmllint: remove duplicate files for linting process
This might lead to QQmlJSLinter::prepareFileForLinting() rejecting the
file, and there is no need for a user to lint a file multiple times.
This is a preparation step for QTBUG-146688.
Task-number: QTBUG-146688
Change-Id: Ib868da5f37b291309f995b02aead77ed4007999d
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Semih Yavuz <semih.yavuz@qt.io>
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/qmllint/main.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/qmllint/main.cpp b/tools/qmllint/main.cpp index 96c30cd2a9..de731e0940 100644 --- a/tools/qmllint/main.cpp +++ b/tools/qmllint/main.cpp @@ -350,7 +350,14 @@ All warnings can be set to four levels of severity: return 0; } - const auto positionalArguments = parser.positionalArguments(); + const auto positionalArguments = [&parser]() { + auto positionalArguments = parser.positionalArguments(); + auto begin = positionalArguments.begin(), end = positionalArguments.end(); + std::sort(begin, end); + positionalArguments.erase(std::unique(begin, end), end); + return positionalArguments; + }(); + if (positionalArguments.isEmpty()) { parser.showHelp(-1); } |
