Skip to content

Commit 1a3f848

Browse files
authored
[clang-tidy] Fix typoed option name in bugprone-signed-char-misuse (llvm#161064)
Following the example of llvm#158282.
1 parent cb8b48e commit 1a3f848

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ static constexpr int UnsignedASCIIUpperBound = 127;
2121
SignedCharMisuseCheck::SignedCharMisuseCheck(StringRef Name,
2222
ClangTidyContext *Context)
2323
: ClangTidyCheck(Name, Context),
24-
CharTypdefsToIgnoreList(Options.get("CharTypdefsToIgnore", "")),
24+
CharTypedefsToIgnoreList(Options.get("CharTypedefsToIgnore", "")),
2525
DiagnoseSignedUnsignedCharComparisons(
2626
Options.get("DiagnoseSignedUnsignedCharComparisons", true)) {}
2727

2828
void SignedCharMisuseCheck::storeOptions(ClangTidyOptions::OptionMap &Opts) {
29-
Options.store(Opts, "CharTypdefsToIgnore", CharTypdefsToIgnoreList);
29+
Options.store(Opts, "CharTypedefsToIgnore", CharTypedefsToIgnoreList);
3030
Options.store(Opts, "DiagnoseSignedUnsignedCharComparisons",
3131
DiagnoseSignedUnsignedCharComparisons);
3232
}
@@ -39,7 +39,7 @@ BindableMatcher<clang::Stmt> SignedCharMisuseCheck::charCastExpression(
3939
// (e.g. typedef char sal_Int8). In this case, we don't need to
4040
// worry about the misinterpretation of char values.
4141
const auto IntTypedef = qualType(hasDeclaration(typedefDecl(
42-
hasAnyName(utils::options::parseStringList(CharTypdefsToIgnoreList)))));
42+
hasAnyName(utils::options::parseStringList(CharTypedefsToIgnoreList)))));
4343

4444
auto CharTypeExpr = expr();
4545
if (IsSigned) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SignedCharMisuseCheck : public ClangTidyCheck {
3535
const ast_matchers::internal::Matcher<clang::QualType> &IntegerType,
3636
const std::string &CastBindName) const;
3737

38-
const StringRef CharTypdefsToIgnoreList;
38+
const StringRef CharTypedefsToIgnoreList;
3939
const bool DiagnoseSignedUnsignedCharComparisons;
4040
};
4141

clang-tools-extra/docs/ReleaseNotes.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,17 @@ Potentially Breaking Changes
5454
:program:`clang-tidy-20`. Users should use the check-specific options of the
5555
same name instead.
5656

57-
- Renamed :program:`clang-tidy`'s option name of check
58-
:doc:`bugprone-easily-swappable-parameters
59-
<clang-tidy/checks/bugprone/easily-swappable-parameters>` from
60-
``NamePrefixSuffixSilenceDissimilarityTreshold`` to
61-
``NamePrefixSuffixSilenceDissimilarityThreshold``,
62-
correcting a spelling mistake.
57+
- Renamed a few :program:`clang-tidy` check options, as they
58+
were misspelled:
59+
60+
- `NamePrefixSuffixSilenceDissimilarityTreshold` to
61+
`NamePrefixSuffixSilenceDissimilarityThreshold` in
62+
:doc:`bugprone-easily-swappable-parameters
63+
<clang-tidy/checks/bugprone/easily-swappable-parameters>`
64+
65+
- `CharTypdefsToIgnore` to `CharTypedefsToIgnore` in
66+
:doc:`bugprone-signed-char-misuse
67+
<clang-tidy/checks/bugprone/signed-char-misuse>`
6368

6469
Improvements to clangd
6570
----------------------

clang-tools-extra/docs/clang-tidy/checks/bugprone/signed-char-misuse.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ so both arguments will have the same type.
107107
Options
108108
-------
109109

110-
.. option:: CharTypdefsToIgnore
110+
.. option:: CharTypedefsToIgnore
111111

112112
A semicolon-separated list of typedef names. In this list, we can list
113113
typedefs for ``char`` or ``signed char``, which will be ignored by the

clang-tools-extra/test/clang-tidy/checkers/bugprone/signed-char-misuse-with-option.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// RUN: %check_clang_tidy %s bugprone-signed-char-misuse %t \
22
// RUN: -config='{CheckOptions: \
3-
// RUN: {bugprone-signed-char-misuse.CharTypdefsToIgnore: "sal_Int8;int8_t"}}' \
3+
// RUN: {bugprone-signed-char-misuse.CharTypedefsToIgnore: "sal_Int8;int8_t"}}' \
44
// RUN: --
55

66
///////////////////////////////////////////////////////////////////

0 commit comments

Comments
 (0)