[Easy][BE]: Enable clang-tidy check for duplicate includes (#116193)

Adds a clang-tidy check to flag duplicate include files
Pull Request resolved: https://github.com/pytorch/pytorch/pull/116193
Approved by: https://github.com/albanD, https://github.com/malfet
This commit is contained in:
Aaron Gokaslan
2023-12-20 17:56:21 +00:00
committed by PyTorch MergeBot
parent fe15645619
commit 71cb13869b
6 changed files with 1 additions and 6 deletions

View File

@ -53,6 +53,7 @@ modernize-*,
performance-*, performance-*,
readability-container-size-empty, readability-container-size-empty,
readability-delete-null-pointer, readability-delete-null-pointer,
readability-duplicate-include
readability-string-compare, readability-string-compare,
' '
HeaderFilterRegex: '^(aten/|c10/|torch/).*$' HeaderFilterRegex: '^(aten/|c10/|torch/).*$'

View File

@ -9,7 +9,6 @@
#include <string> #include <string>
#include <c10/util/Exception.h> #include <c10/util/Exception.h>
#include <ATen/core/interned_strings_class.h> #include <ATen/core/interned_strings_class.h>
#include <c10/util/Exception.h>
namespace c10 { namespace c10 {

View File

@ -11,8 +11,6 @@
#include <torch/csrc/utils/tensor_types.h> #include <torch/csrc/utils/tensor_types.h>
#include <cstring> #include <cstring>
#include <torch/csrc/Exceptions.h>
PyObject* THPDtype_New(at::ScalarType scalar_type, const std::string& name) { PyObject* THPDtype_New(at::ScalarType scalar_type, const std::string& name) {
HANDLE_TH_ERRORS HANDLE_TH_ERRORS
AT_ASSERT(name.length() < DTYPE_NAME_LEN); AT_ASSERT(name.length() < DTYPE_NAME_LEN);

View File

@ -87,7 +87,6 @@
#include <torch/csrc/utils/verbose.h> #include <torch/csrc/utils/verbose.h>
#include <ATen/native/transformers/sdp_utils_cpp.h> #include <ATen/native/transformers/sdp_utils_cpp.h>
#include <c10/util/Logging.h>
#include <torch/csrc/profiler/combined_traceback.h> #include <torch/csrc/profiler/combined_traceback.h>
#include <sstream> #include <sstream>
#ifdef USE_CUDA #ifdef USE_CUDA

View File

@ -12,7 +12,6 @@
#include <torch/csrc/autograd/python_variable.h> #include <torch/csrc/autograd/python_variable.h>
#include <torch/csrc/jit/frontend/tracer.h> #include <torch/csrc/jit/frontend/tracer.h>
#include <torch/csrc/utils/pybind.h>
struct THPSize { struct THPSize {
PyTupleObject tuple; PyTupleObject tuple;

View File

@ -20,7 +20,6 @@
#include <c10/util/flat_hash_map.h> #include <c10/util/flat_hash_map.h>
#include <pybind11/operators.h> #include <pybind11/operators.h>
#include <pybind11/stl.h> #include <pybind11/stl.h>
#include <torch/csrc/jit/python/pybind_utils.h>
#include <torch/csrc/utils/pybind.h> #include <torch/csrc/utils/pybind.h>
#include <torch/csrc/utils/python_raii.h> #include <torch/csrc/utils/python_raii.h>