Skip to content

Commit 9381f07

Browse files
committed
Centralize .clang-tidy configuration files
The .clang-tidy configuration files throughout base/cvd now are all symlinks to files in base/cvd/clang_tidy_configs. This will make it easier to track the variations in our clang-tidy configurations and avoid out-of-sync versions. Bug: b/513004576
1 parent a1c10de commit 9381f07

13 files changed

Lines changed: 70 additions & 319 deletions

File tree

base/cvd/.clang-tidy

Lines changed: 0 additions & 29 deletions
This file was deleted.

base/cvd/.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
clang_tidy_configs/base_config
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# "clang-diagnostic-pragma-once-outside-header" has a bad interaction with the
2+
# `parse_headers` bazel feature.
3+
4+
Checks: &checks >-
5+
bugprone-argument-comment,
6+
clang-analyzer-*,
7+
clang-diagnostic-*,
8+
-clang-diagnostic-pragma-once-outside-header,
9+
misc-definitions-in-headers,
10+
misc-unused-alias-decls,
11+
readability-avoid-const-params-in-decls,
12+
readability-const-return-type,
13+
readability-container-size-empty,
14+
readability-inconsistent-declaration-parameter-name,
15+
readability-misleading-indentation,
16+
readability-redundant-control-flow,
17+
readability-string-compare,
18+
19+
# Using the bazel clang-tidy helper, warnings are not shown from files that
20+
# don't have any errors. "*" here treats everything from `Checks` as an error,
21+
# and from there some exclusions are added.
22+
WarningsAsErrors: >
23+
*,
24+
-clang-analyzer-core.uninitialized.Assign,
25+
-clang-analyzer-core.UndefinedBinaryOperatorResult,
26+
-clang-diagnostic-builtin-macro-redefined,
27+
-clang-diagnostic-pragma-once-outside-header,
28+
-clang-diagnostic-unused-const-variable,
29+
-clang-diagnostic-unused-variable,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# "clang-diagnostic-pragma-once-outside-header" has a bad interaction with the
2+
# `parse_headers` bazel feature.
3+
4+
Checks: &checks >-
5+
bugprone-argument-comment,
6+
clang-analyzer-*,
7+
clang-diagnostic-*,
8+
-clang-diagnostic-pragma-once-outside-header,
9+
misc-definitions-in-headers,
10+
misc-include-cleaner,
11+
misc-unused-alias-decls,
12+
readability-avoid-const-params-in-decls,
13+
readability-const-return-type,
14+
readability-container-size-empty,
15+
readability-inconsistent-declaration-parameter-name,
16+
readability-misleading-indentation,
17+
readability-redundant-control-flow,
18+
readability-string-compare,
19+
20+
# Using the bazel clang-tidy helper, warnings are not shown from files that
21+
# don't have any errors. "*" here treats everything from `Checks` as an error,
22+
# and from there some exclusions are added.
23+
WarningsAsErrors: >
24+
*,
25+
-clang-analyzer-core.uninitialized.Assign,
26+
-clang-analyzer-core.UndefinedBinaryOperatorResult,
27+
-clang-diagnostic-builtin-macro-redefined,
28+
-clang-diagnostic-pragma-once-outside-header,
29+
-clang-diagnostic-unused-const-variable,
30+
-clang-diagnostic-unused-variable,

base/cvd/cuttlefish/host/commands/assemble_cvd/android_build/.clang-tidy

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../clang_tidy_configs/with_include_cleaner

base/cvd/cuttlefish/host/commands/cvd/cli/commands/.clang-tidy

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../clang_tidy_configs/with_include_cleaner

base/cvd/cuttlefish/host/commands/kernel_log_monitor/.clang-tidy

Lines changed: 0 additions & 29 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../clang_tidy_configs/with_include_cleaner

0 commit comments

Comments
 (0)