Skip to content

Commit cc2c2c6

Browse files
Skylion007pytorchmergebot
authored andcommitted
[Easy][BE]: Enable clang-tidy check for duplicate includes (pytorch#116193)
Adds a clang-tidy check to flag duplicate include files Pull Request resolved: pytorch#116193 Approved by: https://github.com/albanD, https://github.com/malfet
1 parent 2dce364 commit cc2c2c6

File tree

6 files changed

+1
-6
lines changed

6 files changed

+1
-6
lines changed

.clang-tidy

+1
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ modernize-*,
5353
performance-*,
5454
readability-container-size-empty,
5555
readability-delete-null-pointer,
56+
readability-duplicate-include
5657
readability-string-compare,
5758
'
5859
HeaderFilterRegex: '^(aten/|c10/|torch/).*$'

aten/src/ATen/core/interned_strings.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <string>
1010
#include <c10/util/Exception.h>
1111
#include <ATen/core/interned_strings_class.h>
12-
#include <c10/util/Exception.h>
1312

1413
namespace c10 {
1514

torch/csrc/Dtype.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <torch/csrc/utils/tensor_types.h>
1212
#include <cstring>
1313

14-
#include <torch/csrc/Exceptions.h>
15-
1614
PyObject* THPDtype_New(at::ScalarType scalar_type, const std::string& name) {
1715
HANDLE_TH_ERRORS
1816
AT_ASSERT(name.length() < DTYPE_NAME_LEN);

torch/csrc/Module.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
#include <torch/csrc/utils/verbose.h>
8888

8989
#include <ATen/native/transformers/sdp_utils_cpp.h>
90-
#include <c10/util/Logging.h>
9190
#include <torch/csrc/profiler/combined_traceback.h>
9291
#include <sstream>
9392
#ifdef USE_CUDA

torch/csrc/Size.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
#include <torch/csrc/autograd/python_variable.h>
1414
#include <torch/csrc/jit/frontend/tracer.h>
15-
#include <torch/csrc/utils/pybind.h>
1615

1716
struct THPSize {
1817
PyTupleObject tuple;

torch/csrc/utils/python_dispatch.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <c10/util/flat_hash_map.h>
2121
#include <pybind11/operators.h>
2222
#include <pybind11/stl.h>
23-
#include <torch/csrc/jit/python/pybind_utils.h>
2423
#include <torch/csrc/utils/pybind.h>
2524
#include <torch/csrc/utils/python_raii.h>
2625

0 commit comments

Comments
 (0)