Skip to content

Commit e188073

Browse files
committed
Clean up includes in console_forwarder
Enables stricter clang-tidy linting for console_forwarder by adding .clang-tidy and updating main.cpp to resolve all include cleaner warnings. Assisted-by: Jetski <jetski@google.com>
1 parent b545852 commit e188073

4 files changed

Lines changed: 14 additions & 3 deletions

File tree

base/cvd/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ filegroup(
3434
"//cuttlefish/common/libs/transport:.clang-tidy",
3535
"//cuttlefish/host:.clang-tidy",
3636
"//cuttlefish/host/commands/assemble_cvd/android_build:.clang-tidy",
37+
"//cuttlefish/host/commands/console_forwarder:.clang-tidy",
3738
"//cuttlefish/host/commands/cvd/cli/commands:.clang-tidy",
3839
"//cuttlefish/host/commands/kernel_log_monitor:.clang-tidy",
3940
"//cuttlefish/host/commands/mkenvimage_slim:.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/host/commands/console_forwarder/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_binary(
810
name = "console_forwarder",
911
srcs = [

base/cvd/cuttlefish/host/commands/console_forwarder/main.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,26 @@
1414
* limitations under the License.
1515
*/
1616

17-
#include <termios.h>
18-
#include <stdlib.h>
17+
#include <asm/ioctls.h>
18+
#include <errno.h>
19+
#include <fcntl.h>
1920
#include <signal.h>
21+
#include <stdlib.h>
22+
#include <sys/ioctl.h>
2023
#include <unistd.h>
2124

2225
#include <condition_variable>
2326
#include <deque>
27+
#include <memory>
2428
#include <mutex>
29+
#include <string>
2530
#include <thread>
31+
#include <utility>
2632
#include <vector>
2733

28-
#include <gflags/gflags.h>
2934
#include "absl/log/check.h"
3035
#include "absl/log/log.h"
36+
#include "gflags/gflags.h"
3137

3238
#include "cuttlefish/common/libs/fs/shared_fd.h"
3339
#include "cuttlefish/common/libs/fs/shared_select.h"
@@ -85,6 +91,7 @@ class ConsoleForwarder {
8591
CHECK_EQ(unlockpt(pty), 0) << StrError(errno);
8692

8793
int packet_mode_enabled = 1;
94+
// NOLINTNEXTLINE(misc-include-cleaner)
8895
CHECK_EQ(ioctl(pty, TIOCPKT, &packet_mode_enabled), 0) << StrError(errno);
8996

9097
auto pty_dev_name = ptsname(pty);

0 commit comments

Comments
 (0)