mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Use clang-tidy 17 (#139678)
Fixes #ISSUE_NUMBER Pull Request resolved: https://github.com/pytorch/pytorch/pull/139678 Approved by: https://github.com/Skylion007
This commit is contained in:
parent
e0156f9faa
commit
a2bc2e38f9
|
|
@ -64,5 +64,5 @@ readability-string-compare,
|
||||||
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'
|
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'
|
||||||
WarningsAsErrors: '*'
|
WarningsAsErrors: '*'
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
misc-header-include-cycle.IgnoredFilesList: 'format.h;ivalue.h;custom_class.h;Dict.h;List.h'
|
misc-header-include-cycle.IgnoredFilesList: 'format.h;ivalue.h;custom_class.h;Dict.h;List.h;IListRef.h'
|
||||||
...
|
...
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ struct C10_API InefficientStdFunctionContext {
|
||||||
deleter_(std::move(rhs.deleter_)) {}
|
deleter_(std::move(rhs.deleter_)) {}
|
||||||
InefficientStdFunctionContext& operator=(
|
InefficientStdFunctionContext& operator=(
|
||||||
const InefficientStdFunctionContext&) = delete;
|
const InefficientStdFunctionContext&) = delete;
|
||||||
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
|
// NOLINTNEXTLINE(*-noexcept-move-*)
|
||||||
InefficientStdFunctionContext& operator=(
|
InefficientStdFunctionContext& operator=(
|
||||||
InefficientStdFunctionContext&& rhs) {
|
InefficientStdFunctionContext&& rhs) {
|
||||||
this->~InefficientStdFunctionContext();
|
this->~InefficientStdFunctionContext();
|
||||||
|
|
|
||||||
|
|
@ -230,6 +230,7 @@ TEST(MetaprogrammingTest, TupleMap_mapsToDifferentTypes) {
|
||||||
|
|
||||||
TEST(MetaprogrammingTest, TupleMap_differentiatesLRValueReferences) {
|
TEST(MetaprogrammingTest, TupleMap_differentiatesLRValueReferences) {
|
||||||
struct Mapper {
|
struct Mapper {
|
||||||
|
// NOLINTNEXTLINE(*move*)
|
||||||
std::string operator()(std::string&& a) const {
|
std::string operator()(std::string&& a) const {
|
||||||
return "moved";
|
return "moved";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ TEST(LoggingTest, TestEnforceFalse) {
|
||||||
CAFFE_ENFORCE(false, "This throws.");
|
CAFFE_ENFORCE(false, "This throws.");
|
||||||
// This should never be triggered.
|
// This should never be triggered.
|
||||||
ADD_FAILURE();
|
ADD_FAILURE();
|
||||||
|
// NOLINTNEXTLINE(*catch*)
|
||||||
} catch (const ::c10::Error&) {
|
} catch (const ::c10::Error&) {
|
||||||
}
|
}
|
||||||
std::swap(FLAGS_caffe2_use_fatal_for_enforce, kFalse);
|
std::swap(FLAGS_caffe2_use_fatal_for_enforce, kFalse);
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ struct bitset final {
|
||||||
|
|
||||||
// Call the given functor with the index of each bit that is set
|
// Call the given functor with the index of each bit that is set
|
||||||
template <class Func>
|
template <class Func>
|
||||||
|
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward)
|
||||||
void for_each_set_bit(Func&& func) const {
|
void for_each_set_bit(Func&& func) const {
|
||||||
bitset cur = *this;
|
bitset cur = *this;
|
||||||
size_t index = cur.find_first_set();
|
size_t index = cur.find_first_set();
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ std::atomic<int> sighupCount(0);
|
||||||
std::atomic<int> hookedUpCount(0);
|
std::atomic<int> hookedUpCount(0);
|
||||||
|
|
||||||
void handleSignal(int signal) {
|
void handleSignal(int signal) {
|
||||||
|
// NOLINTNEXTLINE(bugprone-switch-missing-default-case)
|
||||||
switch (signal) {
|
switch (signal) {
|
||||||
// TODO: what if the previous handler uses sa_sigaction?
|
// TODO: what if the previous handler uses sa_sigaction?
|
||||||
case SIGHUP:
|
case SIGHUP:
|
||||||
|
|
|
||||||
|
|
@ -30,8 +30,8 @@
|
||||||
"hash": "4ed664cf50bb9fddec2d4170b3d7bbe0135dc5648acbd620b61c8d25a5a2fdb7"
|
"hash": "4ed664cf50bb9fddec2d4170b3d7bbe0135dc5648acbd620b61c8d25a5a2fdb7"
|
||||||
},
|
},
|
||||||
"Linux": {
|
"Linux": {
|
||||||
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/15.0.6/clang-tidy",
|
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/17.0.6/clang-tidy",
|
||||||
"hash": "8defeb3a2698caca60251f9d682bc08374f1a37eec77d515533affdd03f93add"
|
"hash": "a93110b0d58b430bb7ce86c8497f2528e1d44eed25d546557e7ec45c44ddfeb7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"actionlint": {
|
"actionlint": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
#include <torch/csrc/utils/python_compat.h>
|
||||||
namespace torch::autograd {
|
namespace torch::autograd {
|
||||||
|
|
||||||
void initNNFunctions(PyObject* module);
|
void initNNFunctions(PyObject* module);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user