Skip to content

Commit

Permalink
[clang-tidy] Enable several bugprone checks
Browse files Browse the repository at this point in the history
This change enables the following bugprone clang-tidy checks:

* bugprone-dangling-handle
* bugprone-inaccurate-erase
* bugprone-string-constructor

bugprone-dangling-handle and bugprone-string-constructor are customized
to cover handles and strings defined in //base as well.

This change was previously announced on cxx@chromium.org:
https://groups.google.com/a/chromium.org/g/cxx/c/hDDUlz1OMUw

Bug: None
Change-Id: I7a2308808eb8cf5d27a0798f50afd6c36c6dca5b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2584937
Auto-Submit: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#837177}
  • Loading branch information
jdoerrie authored and Chromium LUCI CQ committed Dec 15, 2020
1 parent 0c48adc commit 9414992
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
Checks: '-*,
bugprone-argument-comment,
bugprone-dangling-handle,
bugprone-inaccurate-erase,
bugprone-string-constructor,
bugprone-string-integer-assignment,
bugprone-unused-raii,
bugprone-use-after-move,
Expand All @@ -25,6 +28,10 @@
modernize-use-transparent-functors,
readability-redundant-member-init'
CheckOptions:
- key: bugprone-dangling-handle.HandleClasses
value: ::std::basic_string_view;::std::span;::base::BasicStringPiece;::base::span
- key: bugprone-string-constructor.StringNames
value: ::std::basic_string;::std::basic_string_view;::base::BasicStringPiece
- key: modernize-use-default-member-init.UseAssignment
value: 1
# This relaxes modernize-use-emplace in some cases; we might want to make it
Expand Down

0 comments on commit 9414992

Please sign in to comment.