Skip to content

Commit d5a1593

Browse files
authored
Merge branch 'main' into main
2 parents fa5a534 + 9490d58 commit d5a1593

File tree

46 files changed

+709
-307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+709
-307
lines changed

.github/workflows/gha-codeql.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Github Actions CodeQL
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '30 0 * * *'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
codeql:
19+
name: 'Github Actions CodeQL'
20+
runs-on: ubuntu-24.04
21+
permissions:
22+
security-events: write
23+
steps:
24+
- name: Checkout LLVM
25+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
26+
with:
27+
sparse-checkout: |
28+
.github/
29+
- name: Initialize CodeQL
30+
uses: github/codeql-action/init@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
31+
with:
32+
languages: actions
33+
queries: security-extended
34+
- name: Perform CodeQL Analysis
35+
uses: github/codeql-action/analyze@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3

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/docs/clang-tidy/checks/modernize/make-shared.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Options
3737
.. option:: MakeSmartPtrFunctionHeader
3838

3939
A string specifying the corresponding header of make-shared-ptr function.
40-
Default is `memory`.
40+
Default is `<memory>`.
4141

4242
.. option:: IncludeStyle
4343

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) {}

0 commit comments

Comments
 (0)