Skip to content

Commit a2bc2e3

Browse files
cyyeverpytorchmergebot
authored andcommitted
Use clang-tidy 17 (#139678)
Fixes #ISSUE_NUMBER Pull Request resolved: #139678 Approved by: https://github.com/Skylion007
1 parent e0156f9 commit a2bc2e3

File tree

8 files changed

+9
-5
lines changed

8 files changed

+9
-5
lines changed

.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,5 +64,5 @@ readability-string-compare,
6464
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'
6565
WarningsAsErrors: '*'
6666
CheckOptions:
67-
misc-header-include-cycle.IgnoredFilesList: 'format.h;ivalue.h;custom_class.h;Dict.h;List.h'
67+
misc-header-include-cycle.IgnoredFilesList: 'format.h;ivalue.h;custom_class.h;Dict.h;List.h;IListRef.h'
6868
...

c10/core/Allocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ struct C10_API InefficientStdFunctionContext {
234234
deleter_(std::move(rhs.deleter_)) {}
235235
InefficientStdFunctionContext& operator=(
236236
const InefficientStdFunctionContext&) = delete;
237-
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
237+
// NOLINTNEXTLINE(*-noexcept-move-*)
238238
InefficientStdFunctionContext& operator=(
239239
InefficientStdFunctionContext&& rhs) {
240240
this->~InefficientStdFunctionContext();

c10/test/util/Metaprogramming_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ TEST(MetaprogrammingTest, TupleMap_mapsToDifferentTypes) {
230230

231231
TEST(MetaprogrammingTest, TupleMap_differentiatesLRValueReferences) {
232232
struct Mapper {
233+
// NOLINTNEXTLINE(*move*)
233234
std::string operator()(std::string&& a) const {
234235
return "moved";
235236
}

c10/test/util/logging_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ TEST(LoggingTest, TestEnforceFalse) {
2323
CAFFE_ENFORCE(false, "This throws.");
2424
// This should never be triggered.
2525
ADD_FAILURE();
26+
// NOLINTNEXTLINE(*catch*)
2627
} catch (const ::c10::Error&) {
2728
}
2829
std::swap(FLAGS_caffe2_use_fatal_for_enforce, kFalse);

c10/util/Bitset.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ struct bitset final {
5757

5858
// Call the given functor with the index of each bit that is set
5959
template <class Func>
60+
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward)
6061
void for_each_set_bit(Func&& func) const {
6162
bitset cur = *this;
6263
size_t index = cur.find_first_set();

c10/util/signal_handler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ std::atomic<int> sighupCount(0);
3737
std::atomic<int> hookedUpCount(0);
3838

3939
void handleSignal(int signal) {
40+
// NOLINTNEXTLINE(bugprone-switch-missing-default-case)
4041
switch (signal) {
4142
// TODO: what if the previous handler uses sa_sigaction?
4243
case SIGHUP:

tools/linter/adapters/s3_init_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
"hash": "4ed664cf50bb9fddec2d4170b3d7bbe0135dc5648acbd620b61c8d25a5a2fdb7"
3131
},
3232
"Linux": {
33-
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/15.0.6/clang-tidy",
34-
"hash": "8defeb3a2698caca60251f9d682bc08374f1a37eec77d515533affdd03f93add"
33+
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/17.0.6/clang-tidy",
34+
"hash": "a93110b0d58b430bb7ce86c8497f2528e1d44eed25d546557e7ec45c44ddfeb7"
3535
}
3636
},
3737
"actionlint": {

torch/csrc/autograd/python_nn_functions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#pragma once
2-
2+
#include <torch/csrc/utils/python_compat.h>
33
namespace torch::autograd {
44

55
void initNNFunctions(PyObject* module);

0 commit comments

Comments
 (0)