Skip to content
This repository was archived by the owner on Dec 8, 2021. It is now read-only.

Commit b7946e1

Browse files
authored
fix: sync spanner's clang-tidy warnings w/ -cpp (#1480)
This PR installs an exact copy of the .clang-tidy file from `-cpp`. The only real change is that we now ignore the warning about using C arrays. So I also removed the one NOLINT warning that's no longer needed.
1 parent 5e8063b commit b7946e1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.clang-tidy

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
# -modernize-return-braced-init-list: We think removing typenames and using
1414
# only braced-init can hurt readability.
1515
#
16+
# -modernize-avoid-c-arrays: We only use C arrays when they seem to be the
17+
# right tool for the job, such as `char foo[] = "hello"`. In these cases,
18+
# avoiding C arrays often makes the code less readable, and std::array is
19+
# not a drop-in replacement because it doesn't deduce the size.
20+
#
1621
# -performance-move-const-arg: This warning requires the developer to
1722
# know/care more about the implementation details of types/functions than
1823
# should be necessary. For example, `A a; F(std::move(a));` will trigger a
@@ -24,6 +29,7 @@
2429
# counts as a declaration, so if we also declare that friend outside the
2530
# class in order to document it as part of the public API, that will
2631
# trigger a redundant declaration warning from this check.
32+
#
2733
Checks: >
2834
-*,
2935
bugprone-*,
@@ -39,17 +45,18 @@ Checks: >
3945
-misc-non-private-member-variables-in-classes,
4046
-modernize-return-braced-init-list,
4147
-modernize-use-trailing-return-type,
48+
-modernize-avoid-c-arrays,
4249
-performance-move-const-arg,
43-
-readability-named-parameter,
4450
-readability-braces-around-statements,
4551
-readability-magic-numbers,
52+
-readability-named-parameter,
4653
-readability-redundant-declaration
4754
4855
# Turn all the warnings from the checks above into errors.
4956
WarningsAsErrors: "*"
5057

51-
# Enable clang-tidy checks in our headers.
52-
HeaderFilterRegex: "google/cloud/spanner/.*"
58+
# TODO(#3920) - Enable clang-tidy checks in our headers.
59+
HeaderFilterRegex: "google/cloud/(pubsub|spanner)/.*"
5360

5461
CheckOptions:
5562
- { key: readability-identifier-naming.NamespaceCase, value: lower_case }

google/cloud/spanner/benchmarks/benchmarks_config.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ google::cloud::StatusOr<Config> ParseArgs(std::vector<std::string> args) {
6363
std::function<void(Config&, std::string)> parser;
6464
};
6565

66-
// NOLINTNEXTLINE(modernize-avoid-c-arrays)
6766
Flag flags[] = {
6867
{"--experiment=",
6968
[](Config& c, std::string v) { c.experiment = std::move(v); }},

0 commit comments

Comments
 (0)