Commit Graph

3 Commits

Author SHA1 Message Date
Mike Klein
c33d614357 add google-build-namespaces to clang-tidy checks
Android's using this check in their clang-tidy builds.

The check itself is well intentioned but doesn't seem to take into
account the particular reason we do this... being able to use these
types and functions from files compiled with different optimization
settings without causing ODR violations or runtime crashes.

Each of the places that's marked is using an anonymous namespace
from a header for good reason, but I don't mind making clang-tidy
ask us to explicitly exempt any others that may come up in the
future.  It's definitely unusual, and rarely the best idea.

Adding -header-filters='.*' actually checks headers...
until now they've been ignored.

Change-Id: Ie421d2b47076bd384b10c7339cfb7a1c3ea90906
Reviewed-on: https://skia-review.googlesource.com/c/176963
Commit-Queue: Mike Klein <mtklein@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Auto-Submit: Mike Klein <mtklein@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
2018-12-12 16:33:59 +00:00
Mike Klein
21840ed430 restrict -Werror to runs of clang-tidy.sh
Android runs clang-tidy with a different set of checks
that override our choices in .clang-tidy.

Change-Id: I95d92bb9b61bc5f94fe2bb8bff382edd876d2594
Reviewed-on: https://skia-review.googlesource.com/c/176962
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
2018-12-12 14:29:50 +00:00
Mike Klein
1688507f83 Try out clang-tidy, starting with bugprone-use-after-move
- add drop-in clang-tidy cxx wrapper
 - get build clean for bugprone-use-after-move

The wrapper can be used by setting

   cxx = "/path/to/skia/tools/clang-tidy.sh"

in GN.

Change-Id: Idbba911e23bd6ef7530b08fd31906b92c1c1b28c
Reviewed-on: https://skia-review.googlesource.com/c/176523
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
2018-12-11 17:28:19 +00:00