NFC: .clang-tidy: Inherit configs from parents to improve maintainability
In the interests of disabling misc-no-recursion across LLVM (this seems
like a stylistic choice that is not consistent with LLVM's
style/development approach) this NFC preliminary change adjusts all the
.clang-tidy files to inherit from their parents as much as possible.
This change specifically preserves all the quirks of the current configs
in order to make it easier to review as NFC.
I validatad the change is NFC as follows:
for X in `cat ../files.txt`;
do
mkdir -p ../tmp/$(dirname $X)
touch $(dirname $X)/blaikie.cpp
clang-tidy -dump-config $(dirname $X)/blaikie.cpp > ../tmp/$(dirname $X)/after
rm $(dirname $X)/blaikie.cpp
done
(similarly for the "before" state, without this patch applied)
for X in `cat ../files.txt`;
do
echo $X
diff \
../tmp/$(dirname $X)/before \
<(cat ../tmp/$(dirname $X)/after \
| sed -e "s/,readability-identifier-naming\(.*\),-readability-identifier-naming/\1/" \
| sed -e "s/,-llvm-include-order\(.*\),llvm-include-order/\1/" \
| sed -e "s/,-misc-no-recursion\(.*\),misc-no-recursion/\1/" \
| sed -e "s/,-clang-diagnostic-\*\(.*\),clang-diagnostic-\*/\1/")
done
(using sed to strip some add/remove pairs to reduce the diff and make it easier to read)
The resulting report is:
.clang-tidy
clang/.clang-tidy
2c2
< Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-readability-identifier-naming,-misc-no-recursion'
---
> Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-misc-no-recursion'
compiler-rt/.clang-tidy
2c2
< Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,-llvm-header-guard,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes'
---
> Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,clang-diagnostic-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-llvm-header-guard'
flang/.clang-tidy
2c2
< Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,llvm-*,-llvm-include-order,misc-*,-misc-no-recursion,-misc-unused-parameters,-misc-non-private-member-variables-in-classes'
---
> Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,llvm-*,misc-*,-misc-unused-parameters,-misc-non-private-member-variables-in-classes,-llvm-include-order,-misc-no-recursion'
flang/include/flang/Lower/.clang-tidy
flang/include/flang/Optimizer/.clang-tidy
flang/lib/Lower/.clang-tidy
flang/lib/Optimizer/.clang-tidy
lld/.clang-tidy
lldb/.clang-tidy
llvm/tools/split-file/.clang-tidy
mlir/.clang-tidy
The `clang/.clang-tidy` change is a no-op, disabling an option that was never enabled.
The compiler-rt and flang changes are no-op reorderings of the same flags.
(side note, the .clang-tidy file in parallel-libs is broken and crashes
clang-tidy because it uses "lowerCase" as the style instead of "lower_case" -
so I'll deal with that separately)
Differential Revision: https://reviews.llvm.org/D103842
2021-06-08 04:56:02 +08:00
|
|
|
InheritParentConfig: true
|
2021-12-22 08:18:47 +08:00
|
|
|
Checks: >
|
|
|
|
bugprone-argument-comment,
|
|
|
|
bugprone-assert-side-effect,
|
|
|
|
bugprone-branch-clone,
|
|
|
|
bugprone-copy-constructor-init,
|
|
|
|
bugprone-dangling-handle,
|
|
|
|
bugprone-dynamic-static-initializers,
|
|
|
|
bugprone-macro-parentheses,
|
|
|
|
bugprone-macro-repeated-side-effects,
|
|
|
|
bugprone-misplaced-widening-cast,
|
|
|
|
bugprone-move-forwarding-reference,
|
|
|
|
bugprone-multiple-statement-macro,
|
|
|
|
bugprone-suspicious-semicolon,
|
|
|
|
bugprone-swapped-arguments,
|
|
|
|
bugprone-terminating-continue,
|
|
|
|
bugprone-unused-raii,
|
|
|
|
bugprone-unused-return-value,
|
|
|
|
misc-redundant-expression,
|
|
|
|
misc-static-assert,
|
|
|
|
misc-unused-using-decls,
|
|
|
|
modernize-use-bool-literals,
|
|
|
|
modernize-loop-convert,
|
|
|
|
modernize-make-unique,
|
|
|
|
modernize-raw-string-literal,
|
|
|
|
modernize-use-equals-default,
|
|
|
|
modernize-use-default-member-init,
|
|
|
|
modernize-use-emplace,
|
|
|
|
modernize-use-nullptr,
|
|
|
|
modernize-use-override,
|
|
|
|
modernize-use-using,
|
|
|
|
performance-for-range-copy,
|
|
|
|
performance-implicit-conversion-in-loop,
|
|
|
|
performance-inefficient-algorithm,
|
|
|
|
performance-inefficient-vector-operation,
|
|
|
|
performance-move-const-arg,
|
|
|
|
performance-no-automatic-move,
|
|
|
|
performance-trivially-destructible,
|
|
|
|
performance-unnecessary-copy-initialization,
|
|
|
|
performance-unnecessary-value-param,
|
|
|
|
readability-avoid-const-params-in-decls,
|
|
|
|
readability-const-return-type,
|
|
|
|
readability-container-size-empty,
|
|
|
|
readability-inconsistent-declaration-parameter-name,
|
|
|
|
readability-misleading-indentation,
|
|
|
|
readability-redundant-control-flow,
|
|
|
|
readability-simplify-boolean-expr,
|
|
|
|
readability-simplify-subscript-expr,
|
|
|
|
readability-use-anyofallof
|
|
|
|
|
|
|
|
|
2019-12-27 05:41:25 +08:00
|
|
|
CheckOptions:
|
2020-03-08 01:43:10 +08:00
|
|
|
- key: readability-identifier-naming.MemberCase
|
|
|
|
value: camelBack
|
|
|
|
- key: readability-identifier-naming.ParameterCase
|
|
|
|
value: camelBack
|
|
|
|
- key: readability-identifier-naming.VariableCase
|
|
|
|
value: camelBack
|