Skip to content

Commit 7f33f1b

Browse files
committed
Apply include-cleaner clang-tidy config to flag_parser
Add .clang-tidy symlink pointing to with_include_cleaner and add necessary includes to make it pass. Assisted-by: Jetski:Gemini Next Bug: b/523396865 Test: bazel test //...
1 parent 45d9b0a commit 7f33f1b

8 files changed

Lines changed: 16 additions & 2 deletions

File tree

base/cvd/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ filegroup(
2929
".clang-tidy",
3030
"//cuttlefish/io:.clang-tidy",
3131
"//cuttlefish/common/libs/key_equals_value:.clang-tidy",
32+
"//cuttlefish/flag_parser:.clang-tidy",
3233
"//cuttlefish/host/commands/assemble_cvd/android_build:.clang-tidy",
3334
"//cuttlefish/host/commands/cvd/cli/commands:.clang-tidy",
3435
"//cuttlefish/host/commands/kernel_log_monitor:.clang-tidy",
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/flag_parser/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ package(
44
default_visibility = ["//:android_cuttlefish"],
55
)
66

7+
exports_files([".clang-tidy"])
8+
79
cf_cc_library(
810
name = "flag_parser",
911
srcs = [

base/cvd/cuttlefish/flag_parser/flag.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,20 @@
1717
#include "cuttlefish/flag_parser/flag.h"
1818

1919
#include <algorithm>
20+
#include <cstddef>
2021
#include <functional>
2122
#include <iostream>
2223
#include <ostream>
24+
#include <span>
2325
#include <string>
26+
#include <string_view>
2427
#include <unordered_set>
2528
#include <utility>
2629
#include <vector>
2730

2831
#include "absl/cleanup/cleanup.h"
2932
#include "absl/log/check.h"
33+
#include "absl/strings/str_cat.h"
3034
#include "absl/strings/str_join.h"
3135
#include "absl/strings/str_replace.h"
3236
#include "absl/strings/strip.h"

base/cvd/cuttlefish/flag_parser/flag_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717

1818
#include "cuttlefish/flag_parser/flag.h"
1919

20-
#include <stdint.h>
21-
2220
#include <string>
2321
#include <string_view>
22+
#include <utility>
2423
#include <vector>
2524

2625
#include "gmock/gmock-matchers.h"
2726
#include "gtest/gtest.h"
2827

2928
#include "cuttlefish/flag_parser/gflags_compat.h"
29+
#include "cuttlefish/result/result.h"
3030
#include "cuttlefish/result/result_matchers.h"
3131

3232
namespace cuttlefish {

base/cvd/cuttlefish/flag_parser/gflags_compat.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
#include "cuttlefish/flag_parser/gflags_compat.h"
1818

1919
#include <concepts>
20+
#include <cstddef>
21+
#include <cstdint>
22+
#include <cstdlib>
2023
#include <iostream>
2124
#include <optional>
2225
#include <ostream>

base/cvd/cuttlefish/flag_parser/gflags_compat_test.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <stdint.h>
2020

2121
#include <map>
22+
#include <memory>
2223
#include <optional>
2324
#include <sstream>
2425
#include <string>

base/cvd/cuttlefish/flag_parser/shared_fd_flag.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@
1818
#include <unistd.h>
1919

2020
#include <string>
21+
#include <string_view>
2122

2223
#include "absl/strings/numbers.h"
2324

2425
#include "cuttlefish/common/libs/fs/shared_fd.h"
26+
#include "cuttlefish/flag_parser/flag.h"
2527
#include "cuttlefish/result/result.h"
2628

2729
namespace cuttlefish {

0 commit comments

Comments
 (0)