Enable checking headers with Clang Tidy. (flutter/engine#46009)
Closes https://github.com/flutter/flutter/issues/134969. Turns out this was literally 1 line. Tested locally: ```shell dart tools/clang_tidy/bin/main.dart \ --target-variant host_debug_unopt_arm64 \ --lint-all \ --checks="-*,llvm-header-guard" ``` <details> <summary>Local Test Results</summary> Here is a tiny snippet showing this is indeed doing something: ```txt [0:02] Jobs: 0% done, 0/1033 completed, 7 in progress, 1019 pending, 7 failed. ❌ Failures for clang-tidy on /Users/matanl/Developer/engine/src/flutter/display_list/dl_blend_mode.cc: ../../flutter/display_list/dl_blend_mode.h:5:9: error: header guard does not follow preferred style [llvm-header-guard,-warnings-as-errors] 5 | #ifndef FLUTTER_DISPLAY_LIST_DL_BLEND_MODE_H_ | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | USERS_MATANL_DEVELOPER_ENGINE_SRC_OUT_HOST_DEBUG_UNOPT_ARM64_______FLUTTER_DISPLAY_LIST_DL_BLEND_MODE_H 6 | #define FLUTTER_DISPLAY_LIST_DL_BLEND_MODE_H_ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | USERS_MATANL_DEVELOPER_ENGINE_SRC_OUT_HOST_DEBUG_UNOPT_ARM64_______FLUTTER_DISPLAY_LIST_DL_BLEND_MODE_H ^C ``` </details> This will likely show failures on CI, so I'm following [our published directions](https://github.com/flutter/flutter/wiki/Engine-Clang-Tidy-Linter#clang-tidy-fix-on-ci) to get CI to tell me what needs to get fixed, and won't submit until there are no warnings at HEAD. As such, not seeking LGTM yet (draft). --------- Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com>
This commit is contained in:
@@ -39,3 +39,11 @@ CheckOptions:
|
||||
value: "lower_case"
|
||||
- key: readability-identifier-naming.PrivateMemberSuffix
|
||||
value: "_"
|
||||
|
||||
# Lint headers within paths that contain "/flutter/" but not:
|
||||
# - gen (generated code, the fact it compiles is good enough™)
|
||||
# - third_party (we didn't author most of the code, and can't fix the lints)
|
||||
#
|
||||
# Note this is because of our buildroot setup, so the full path of a lint is:
|
||||
# "../../flutter/impeller/core/runtime_types.h:1:1" as reported.
|
||||
HeaderFilterRegex: "(!third_party/)(!gen/).*/flutter/.*"
|
||||
|
||||
Reference in New Issue
Block a user