summaryrefslogtreecommitdiff
path: root/docs/tidy.md
diff options
context:
space:
mode:
author Chih-Hung Hsieh <chh@google.com> 2022-05-05 14:46:34 -0700
committer Chih-Hung Hsieh <chh@google.com> 2022-05-05 14:46:34 -0700
commitf3efde5e7292248a6cae4a0e433dcefc1aef48f6 (patch)
tree4b05debf437fc3df5d43ada298ab475bb506af4e /docs/tidy.md
parent958c957696e1b1570c9f5feba705577baaa75c54 (diff)
Add ALLOW_LOCAL_TIDY_TRUE
Bug: 229779921 Test: presubmit Change-Id: I9ee65fbb96fc68a949e33b63b83d0609696d76a1
Diffstat (limited to 'docs/tidy.md')
-rw-r--r--docs/tidy.md15
1 files changed, 13 insertions, 2 deletions
diff --git a/docs/tidy.md b/docs/tidy.md
index 890c3a036..2eb8234c7 100644
--- a/docs/tidy.md
+++ b/docs/tidy.md
@@ -31,7 +31,7 @@ The default global clang-tidy checks and flags are defined in
The global default can be overwritten by module properties in Android.bp.
-### `tidy` and `tidy_checks`
+### `tidy`, `tidy_checks`, and `ALLOW_LOCAL_TIDY_TRUE`
For example, in
[system/bpf/Android.bp](https://android.googlesource.com/platform/system/bpf/+/refs/heads/master/Android.bp),
@@ -52,8 +52,16 @@ cc_defaults {
}
```
That means in normal builds, even without `WITH_TIDY=1`,
-the modules that use `bpf_defaults` will run clang-tidy
+the modules that use `bpf_defaults` _should_ run clang-tidy
over C/C++ source files with the given `tidy_checks`.
+
+However since clang-tidy warnings and its runtime cost might
+not be wanted by all people, the default is to ignore the
+`tidy:true` property unless the environment variable
+`ALLOW_LOCAL_TIDY_TRUE` is set to true or 1.
+To run clang-tidy on all modules that should be tested with clang-tidy,
+`ALLOW_LOCAL_TIDY_TRUE` or `WITH_TIDY` should be set to true or 1.
+
Note that `clang-analyzer-security*` is included in `tidy_checks`
but not all `clang-analyzer-*` checks. Check `cert-err34-c` is
disabled, although `cert-*` is selected.
@@ -80,6 +88,9 @@ cc_test_library {
}
```
+Note that `tidy:false` always disables clang-tidy, no matter
+`ALLOW_LOCAL_TIDY_TRUE` is set or not.
+
### `tidy_checks_as_errors`
The global tidy checks are enabled as warnings.