Skip to content

Commit de04d42

Browse files
authored
[clang-tidy] Fixed typo for bugprone-easily-swappable-parameters clang-tidy check (#158282)
I came across this little typo mistake while reading the docs, so I've fixed it :)
1 parent ee2a225 commit de04d42

15 files changed

+29
-24
lines changed

clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static constexpr bool DefaultModelImplicitConversions = true;
8282
/// used together.
8383
static constexpr bool DefaultSuppressParametersUsedTogether = true;
8484

85-
/// The default value for the NamePrefixSuffixSilenceDissimilarityTreshold
85+
/// The default value for the NamePrefixSuffixSilenceDissimilarityThreshold
8686
/// check option.
8787
static constexpr std::size_t
8888
DefaultNamePrefixSuffixSilenceDissimilarityTreshold = 1;
@@ -1435,7 +1435,7 @@ static MixableParameterRange modelMixingRange(
14351435
StringRef PrevParamName = FD->getParamDecl(I - 1)->getName();
14361436
if (!ParamName.empty() && !PrevParamName.empty() &&
14371437
filter::prefixSuffixCoverUnderThreshold(
1438-
Check.NamePrefixSuffixSilenceDissimilarityTreshold, PrevParamName,
1438+
Check.NamePrefixSuffixSilenceDissimilarityThreshold, PrevParamName,
14391439
ParamName)) {
14401440
LLVM_DEBUG(llvm::dbgs() << "Parameter '" << ParamName
14411441
<< "' follows a pattern with previous parameter '"
@@ -2108,8 +2108,8 @@ EasilySwappableParametersCheck::EasilySwappableParametersCheck(
21082108
SuppressParametersUsedTogether(
21092109
Options.get("SuppressParametersUsedTogether",
21102110
DefaultSuppressParametersUsedTogether)),
2111-
NamePrefixSuffixSilenceDissimilarityTreshold(
2112-
Options.get("NamePrefixSuffixSilenceDissimilarityTreshold",
2111+
NamePrefixSuffixSilenceDissimilarityThreshold(
2112+
Options.get("NamePrefixSuffixSilenceDissimilarityThreshold",
21132113
DefaultNamePrefixSuffixSilenceDissimilarityTreshold)) {}
21142114

21152115
void EasilySwappableParametersCheck::storeOptions(
@@ -2123,8 +2123,8 @@ void EasilySwappableParametersCheck::storeOptions(
21232123
Options.store(Opts, "ModelImplicitConversions", ModelImplicitConversions);
21242124
Options.store(Opts, "SuppressParametersUsedTogether",
21252125
SuppressParametersUsedTogether);
2126-
Options.store(Opts, "NamePrefixSuffixSilenceDissimilarityTreshold",
2127-
NamePrefixSuffixSilenceDissimilarityTreshold);
2126+
Options.store(Opts, "NamePrefixSuffixSilenceDissimilarityThreshold",
2127+
NamePrefixSuffixSilenceDissimilarityThreshold);
21282128
}
21292129

21302130
void EasilySwappableParametersCheck::registerMatchers(MatchFinder *Finder) {

clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class EasilySwappableParametersCheck : public ClangTidyCheck {
5454
/// either end for the report about the parameters to be silenced.
5555
/// E.g. the names "LHS" and "RHS" are 1-dissimilar suffixes of each other,
5656
/// while "Text1" and "Text2" are 1-dissimilar prefixes of each other.
57-
const std::size_t NamePrefixSuffixSilenceDissimilarityTreshold;
57+
const std::size_t NamePrefixSuffixSilenceDissimilarityThreshold;
5858
};
5959

6060
} // namespace clang::tidy::bugprone

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Improvements to clang-tidy
135135
:program:`clang-tidy-20`. Users should use the check-specific options of the
136136
same name instead.
137137

138-
- Improved :program:`run-clang-tidy.py` and :program:`clang-tidy-diff.py`
138+
- Improved :program:`run-clang-tidy.py` and :program:`clang-tidy-diff.py`
139139
scripts by adding the `-hide-progress` option to suppress progress and
140140
informational messages.
141141

@@ -190,6 +190,11 @@ New check aliases
190190
Changes in existing checks
191191
^^^^^^^^^^^^^^^^^^^^^^^^^^
192192

193+
- Improved :doc:`bugprone-easily-swappable-parameters
194+
<clang-tidy/checks/bugprone/easily-swappable-parameters>` check by
195+
correcting a spelling mistake on its option
196+
``NamePrefixSuffixSilenceDissimilarityTreshold``.
197+
193198
- Improved :doc:`bugprone-infinite-loop
194199
<clang-tidy/checks/bugprone/infinite-loop>` check by adding detection for
195200
variables introduced by structured bindings.
@@ -213,8 +218,8 @@ Changes in existing checks
213218
tagged union respectively.
214219

215220
- Improved :doc:`bugprone-unchecked-optional-access
216-
<clang-tidy/checks/bugprone/unchecked-optional-access>` check by supporting
217-
``NullableValue::makeValue`` and ``NullableValue::makeValueInplace`` to
221+
<clang-tidy/checks/bugprone/unchecked-optional-access>` check by supporting
222+
``NullableValue::makeValue`` and ``NullableValue::makeValueInplace`` to
218223
prevent false-positives for ``BloombergLP::bdlb::NullableValue`` type.
219224

220225
- Improved :doc:`bugprone-unhandled-self-assignment

clang-tools-extra/docs/clang-tidy/checks/bugprone/easily-swappable-parameters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ noisiness.
169169
* Separate ``return`` statements return either of the parameters on
170170
different code paths.
171171

172-
.. option:: NamePrefixSuffixSilenceDissimilarityTreshold
172+
.. option:: NamePrefixSuffixSilenceDissimilarityThreshold
173173

174174
The number of characters two parameter names might be different on *either*
175175
the head or the tail end with the rest of the name the same so that the

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-ignore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
void ignoredUnnamed(int I, int, int) {} // NO-WARN: No >= 2 length of non-unnamed.

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicit-qualifiers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 1, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
void numericAndQualifierConversion(int I, const double CD) { numericAndQualifierConversion(CD, I); }

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
void implicitDoesntBreakOtherStuff(int A, int B) {}

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-implicits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 1, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
void implicitDoesntBreakOtherStuff(int A, int B) {}

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-len2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
namespace std {

clang-tools-extra/test/clang-tidy/checkers/bugprone/easily-swappable-parameters-len3.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// RUN: bugprone-easily-swappable-parameters.QualifiersMix: 0, \
77
// RUN: bugprone-easily-swappable-parameters.ModelImplicitConversions: 0, \
88
// RUN: bugprone-easily-swappable-parameters.SuppressParametersUsedTogether: 0, \
9-
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityTreshold: 0 \
9+
// RUN: bugprone-easily-swappable-parameters.NamePrefixSuffixSilenceDissimilarityThreshold: 0 \
1010
// RUN: }}' --
1111

1212
int add(int Left, int Right) { return Left + Right; } // NO-WARN: Only 2 parameters.

0 commit comments

Comments
 (0)