Skip to content

Commit a8eb741

Browse files
committed
Revert "[clang-tidy] Sort options in --dump-config"
This reverts commit 2cdb843.
1 parent a81e1f0 commit a8eb741

File tree

3 files changed

+6
-19
lines changed

3 files changed

+6
-19
lines changed

clang-tools-extra/clang-tidy/ClangTidyOptions.cpp

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "llvm/Support/MemoryBufferRef.h"
1717
#include "llvm/Support/Path.h"
1818
#include "llvm/Support/YAMLTraits.h"
19-
#include <algorithm>
2019
#include <optional>
2120
#include <utility>
2221

@@ -86,21 +85,14 @@ template <>
8685
void yamlize(IO &IO, ClangTidyOptions::OptionMap &Options, bool,
8786
EmptyContext &Ctx) {
8887
if (IO.outputting()) {
89-
// Ensure check options are sorted
90-
std::vector<std::pair<StringRef, StringRef>> SortedOptions;
91-
SortedOptions.reserve(Options.size());
92-
for (auto &Key : Options) {
93-
SortedOptions.emplace_back(Key.getKey(), Key.getValue().Value);
94-
}
95-
std::sort(SortedOptions.begin(), SortedOptions.end());
96-
9788
IO.beginMapping();
9889
// Only output as a map
99-
for (auto &Option : SortedOptions) {
100-
bool UseDefault = false;
101-
void *SaveInfo = nullptr;
102-
IO.preflightKey(Option.first.data(), true, false, UseDefault, SaveInfo);
103-
IO.scalarString(Option.second, needsQuotes(Option.second));
90+
for (auto &Key : Options) {
91+
bool UseDefault;
92+
void *SaveInfo;
93+
IO.preflightKey(Key.getKey().data(), true, false, UseDefault, SaveInfo);
94+
StringRef S = Key.getValue().Value;
95+
IO.scalarString(S, needsQuotes(S));
10496
IO.postflightKey(SaveInfo);
10597
}
10698
IO.endMapping();

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,6 @@ Improvements to clang-tidy
111111
- Remove configuration option `AnalyzeTemporaryDestructors`, which was deprecated since
112112
:program:`clang-tidy` 16.
113113

114-
- Improved `--dump-config` to print check options in alphabetical order.
115-
116114
New checks
117115
^^^^^^^^^^
118116

clang-tools-extra/test/clang-tidy/infrastructure/config-files.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,3 @@
5454
// RUN: %S/Inputs/config-files/4/44/- -- | FileCheck %s -check-prefix=CHECK-CHILD6
5555
// CHECK-CHILD6: Checks: {{.*-llvm-qualified-auto'? *$}}
5656
// CHECK-CHILD6-NOT: modernize-use-using.IgnoreMacros
57-
58-
// Validate that check options are printed in alphabetical order:
59-
// RUN: clang-tidy --checks="-*,readability-identifier-*" --dump-config | grep readability-identifier-naming | sort --check

0 commit comments

Comments
 (0)