mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Summary: This PR adds the final set of clang-tidy checks we should add for our codebase: a last set of performance-related checks. Most fixes here are around changing `auto` to `const auto&` in a few places where unnecessary copies were made, and adding `reserve()` calls before loops doing repeated `push_back()`. Also a few cases of calling `std::string::find` with a single-character string literal instead of a single char, which uses a less efficient string search algorithm meant for searching larger substrings.  ezyang apaszke Pull Request resolved: https://github.com/pytorch/pytorch/pull/15198 Differential Revision: D13468797 Pulled By: goldsborough fbshipit-source-id: 2bed1ea1c7c162b7f3e0e1026f17125e88c4d5b2
35 lines
1.0 KiB
YAML
35 lines
1.0 KiB
YAML
---
|
|
# NOTE there must be no spaces before the '-', so put the comma first.
|
|
Checks: '
|
|
-*
|
|
,bugprone-*
|
|
,-bugprone-forward-declaration-namespace
|
|
,-bugprone-macro-parentheses
|
|
,cppcoreguidelines-*
|
|
,-cppcoreguidelines-interfaces-global-init
|
|
,-cppcoreguidelines-owning-memory
|
|
,-cppcoreguidelines-pro-bounds-array-to-pointer-decay
|
|
,-cppcoreguidelines-pro-bounds-constant-array-index
|
|
,-cppcoreguidelines-pro-bounds-pointer-arithmetic
|
|
,-cppcoreguidelines-pro-type-cstyle-cast
|
|
,-cppcoreguidelines-pro-type-reinterpret-cast
|
|
,-cppcoreguidelines-pro-type-static-cast-downcast
|
|
,-cppcoreguidelines-pro-type-union-access
|
|
,-cppcoreguidelines-pro-type-vararg
|
|
,-cppcoreguidelines-special-member-functions
|
|
,hicpp-exception-baseclass
|
|
,hicpp-avoid-goto
|
|
,modernize-*
|
|
,-modernize-return-braced-init-list
|
|
,-modernize-use-auto
|
|
,-modernize-use-default-member-init
|
|
,-modernize-use-using
|
|
,performance-*
|
|
,-performance-noexcept-move-constructor
|
|
'
|
|
WarningsAsErrors: '*'
|
|
HeaderFilterRegex: 'torch/csrc/.*'
|
|
AnalyzeTemporaryDtors: false
|
|
CheckOptions:
|
|
...
|