[clang-tidy] Update checks and documentation
Disables two readability checks deemed unnecessary and re-enables
modernize-use-auto on request. Also disables clang-analyzer-* checks due
to numerous false positive issues, which will be investigated and
possibly re-enabled in the future.
Bug: FIDL-643
Change-Id: If8521f9235282eb13465360f5ddf7dd89eea853e
diff --git a/.clang-tidy b/.clang-tidy
index 10c4558..69d60fa 100644
--- a/.clang-tidy
+++ b/.clang-tidy
@@ -1,5 +1,24 @@
---
-Checks: 'bugprone-*,clang-diagnostic-*,-clang-diagnostic-unused-command-line-argument,clang-analyzer-*,-clang-analyzer-core.NullDereference,-clang-analyzer-unix.Malloc,google-*,misc-*,-misc-noexcept*,modernize-*,-modernize-deprecated-headers,-modernize-raw-string-literal,-modernize-return-braced-init-list,-modernize-use-auto,-modernize-use-equals-delete,-modernize-use-equals-default,performance-*,-performance-unnecessary-value-param,readability-*,-readability-implicit-bool-conversion'
+Checks: >
+ -*,
+ bugprone-*,
+ clang-diagnostic-*,
+ -clang-diagnostic-unused-command-line-argument,
+ google-*,
+ misc-*,
+ -misc-noexcept*,
+ modernize-*,
+ -modernize-deprecated-headers,
+ -modernize-raw-string-literal,
+ -modernize-return-braced-init-list,
+ -modernize-use-equals-delete,
+ -modernize-use-equals-default,
+ performance-*,
+ -performance-unnecessary-value-param,
+ readability-*,
+ -readability-implicit-bool-conversion,
+ -readability-isolate-declaration,
+ -readability-uppercase-literal-suffix
WarningsAsErrors: false
HeaderFilterRegex: '\.\./.*/([^t].*|t[^h].*|th[^i].*)'
AnalyzeTemporaryDtors: false
diff --git a/docs/development/languages/c-cpp/lint.md b/docs/development/languages/c-cpp/lint.md
index d56120e..3dd74d9 100644
--- a/docs/development/languages/c-cpp/lint.md
+++ b/docs/development/languages/c-cpp/lint.md
@@ -40,7 +40,6 @@
- `bugprone-*`
- `clang-diagnostic-*`
- - `clang-analyzer-*`
- `google-*`
- `misc-*`
- `modernize-`
@@ -49,10 +48,6 @@
This list tracks the reasons for which we disabled in particular [checks]:
- - `clang-analyzer-core.NullDereference`, `clang-analyzer-unix.Malloc` - these
- checks are triggering memory access warnings at rapidjson callsites (despite
- the header filter regex) and we didn't find a more granular way to disable
- them
- `clang-diagnostic-unused-command-line-argument` - ninja-generated compilation
database contains the linker argument which ends up unused and triggers this
warning for every file
@@ -63,8 +58,6 @@
- `modernize-return-braced-init-list` - concerns about readability of returning
braced initialization list for constructor arguments, prefer to use a
constructor explicitly
- - `modernize-use-auto` - not all flagged callsites seemed worth converting to
- `auto`
- `modernize-use-equals-delete` - flagging all gtest TEST_F
- `modernize-use-equals-default` - Fuchsia chose not to impose a preference for
"= default"
@@ -72,5 +65,8 @@
which we prefer to pass by value
- `readability-implicit-bool-conversion` - Fuchsia C++ code commonly uses implicit
bool cast of pointers and numbers
+ - `readability-isolate-declaration` - Zircon code commonly uses paired declarations.
+ - `readability-uppercase-literal-suffix` - Fuchsia C++ code chooses not to impose
+ a style on this.
[checks]: https://clang.llvm.org/extra/clang-tidy/checks/list.html