Skip to content

Commit

Permalink
Use clang-tidy 17 (pytorch#139678)
Browse files Browse the repository at this point in the history
Fixes #ISSUE_NUMBER

Pull Request resolved: pytorch#139678
Approved by: https://github.com/Skylion007
  • Loading branch information
cyyever authored and pytorchmergebot committed Nov 5, 2024
1 parent e0156f9 commit a2bc2e3
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,5 @@ readability-string-compare,
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'
WarningsAsErrors: '*'
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'
...
2 changes: 1 addition & 1 deletion c10/core/Allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ struct C10_API InefficientStdFunctionContext {
deleter_(std::move(rhs.deleter_)) {}
InefficientStdFunctionContext& operator=(
const InefficientStdFunctionContext&) = delete;
// NOLINTNEXTLINE(performance-noexcept-move-constructor)
// NOLINTNEXTLINE(*-noexcept-move-*)
InefficientStdFunctionContext& operator=(
InefficientStdFunctionContext&& rhs) {
this->~InefficientStdFunctionContext();
Expand Down
1 change: 1 addition & 0 deletions c10/test/util/Metaprogramming_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ TEST(MetaprogrammingTest, TupleMap_mapsToDifferentTypes) {

TEST(MetaprogrammingTest, TupleMap_differentiatesLRValueReferences) {
struct Mapper {
// NOLINTNEXTLINE(*move*)
std::string operator()(std::string&& a) const {
return "moved";
}
Expand Down
1 change: 1 addition & 0 deletions c10/test/util/logging_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ TEST(LoggingTest, TestEnforceFalse) {
CAFFE_ENFORCE(false, "This throws.");
// This should never be triggered.
ADD_FAILURE();
// NOLINTNEXTLINE(*catch*)
} catch (const ::c10::Error&) {
}
std::swap(FLAGS_caffe2_use_fatal_for_enforce, kFalse);
Expand Down
1 change: 1 addition & 0 deletions c10/util/Bitset.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ struct bitset final {

// Call the given functor with the index of each bit that is set
template <class Func>
// NOLINTNEXTLINE(cppcoreguidelines-missing-std-forward)
void for_each_set_bit(Func&& func) const {
bitset cur = *this;
size_t index = cur.find_first_set();
Expand Down
1 change: 1 addition & 0 deletions c10/util/signal_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ std::atomic<int> sighupCount(0);
std::atomic<int> hookedUpCount(0);

void handleSignal(int signal) {
// NOLINTNEXTLINE(bugprone-switch-missing-default-case)
switch (signal) {
// TODO: what if the previous handler uses sa_sigaction?
case SIGHUP:
Expand Down
4 changes: 2 additions & 2 deletions tools/linter/adapters/s3_init_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"hash": "4ed664cf50bb9fddec2d4170b3d7bbe0135dc5648acbd620b61c8d25a5a2fdb7"
},
"Linux": {
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/15.0.6/clang-tidy",
"hash": "8defeb3a2698caca60251f9d682bc08374f1a37eec77d515533affdd03f93add"
"download_url": "https://oss-clang-format.s3.us-east-2.amazonaws.com/linux64/17.0.6/clang-tidy",
"hash": "a93110b0d58b430bb7ce86c8497f2528e1d44eed25d546557e7ec45c44ddfeb7"
}
},
"actionlint": {
Expand Down
2 changes: 1 addition & 1 deletion torch/csrc/autograd/python_nn_functions.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#pragma once

#include <torch/csrc/utils/python_compat.h>
namespace torch::autograd {

void initNNFunctions(PyObject* module);
Expand Down

0 comments on commit a2bc2e3

Please sign in to comment.