0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-02 09:46:52 -05:00
bitcoin-bitcoin-core/src/.clang-tidy
merge-script 00feabf6c5
Merge bitcoin/bitcoin#30234: Enable clang-tidy checks for self-assignment
26a7f70b5d ci: enable self-assignment clang-tidy check (Cory Fields)
32b1d13792 refactor: add self-assign checks to classes which violate the clang-tidy check (Cory Fields)

Pull request description:

  See comment here: https://github.com/bitcoin/bitcoin/pull/30161#issuecomment-2148229582

  Our code failed these checks in three places, which have been fixed up here. Though these appear to have been harmless, adding the check avoids the copy in the self-assignment case so there should be no downside.

  ~Additionally, minisketch failed the check as well. See https://github.com/sipa/minisketch/pull/87~
  Edit: Done

  After fixing up the violations, turn on the aggressive clang-tidy check.

  Note for reviewers: `git diff -w` makes this trivial to review.

ACKs for top commit:
  hebasto:
    ACK 26a7f70b5d, I have reviewed the code and it looks OK.
  TheCharlatan:
    ACK 26a7f70b5d

Tree-SHA512: 74d8236a1b5a698f2f61c4740c4fc77788b7f882c4b395acc4e6bfef1ec8a4554ea8821a26b14d70cfa6c8e2e9ea305deeea3fbf323967fa19343c007a53c5ba
2024-07-11 19:21:05 +01:00

34 lines
937 B
YAML

Checks: '
-*,
bitcoin-*,
bugprone-argument-comment,
bugprone-move-forwarding-reference,
bugprone-string-constructor,
bugprone-use-after-move,
bugprone-lambda-function-name,
bugprone-unhandled-self-assignment,
misc-unused-using-decls,
misc-no-recursion,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
modernize-use-noexcept,
modernize-use-nullptr,
performance-*,
-performance-avoid-endl,
-performance-enum-size,
-performance-inefficient-string-concatenation,
-performance-no-int-to-ptr,
-performance-noexcept-move-constructor,
-performance-unnecessary-value-param,
readability-const-return-type,
readability-redundant-declaration,
readability-redundant-string-init,
'
HeaderFilterRegex: '.'
WarningsAsErrors: '*'
CheckOptions:
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField
value: false