Only run clang-tidy in presubmit when C, C++, ObjC, or ObjC++ files change (flutter/engine#36887)

This commit is contained in:
Jenn Magder 2022-10-28 11:20:09 -07:00 committed by GitHub
parent a1c002128b
commit 966d0ccebb
2 changed files with 55 additions and 0 deletions

View File

@ -194,6 +194,17 @@ targets:
lint_android: "false"
lint_host: "true"
timeout: 60
runIf:
- DEPS
- .ci.yaml
- tools/**
- ci/**
- "**.h"
- "**.c"
- "**.cc"
- "**.fbs"
- "**.frag"
- "**.vert"
- name: Linux Android clang-tidy
recipe: engine/engine_lint
@ -203,6 +214,18 @@ targets:
lint_android: "true"
lint_host: "false"
timeout: 60
runIf:
- DEPS
- .ci.yaml
- tools/**
- ci/**
- "**.h"
- "**.c"
- "**.cc"
- "**.fbs"
- "**.frag"
- "**.vert"
- "**.py" # Run pylint on the fastest clang-tidy builder.
- name: Linux Arm Host Engine
recipe: engine/engine_arm
@ -336,6 +359,19 @@ targets:
lint_host: "true"
lint_ios: "false"
timeout: 75
runIf:
- DEPS
- .ci.yaml
- tools/**
- ci/**
- "**.h"
- "**.c"
- "**.cc"
- "**.fbs"
- "**.frag"
- "**.vert"
- "**.m"
- "**.mm"
- name: Mac iOS clang-tidy
recipe: engine/engine_lint
@ -345,6 +381,19 @@ targets:
lint_host: "false"
lint_ios: "true"
timeout: 75
runIf:
- DEPS
- .ci.yaml
- tools/**
- ci/**
- "**.h"
- "**.c"
- "**.cc"
- "**.fbs"
- "**.frag"
- "**.vert"
- "**.m"
- "**.mm"
- name: Mac iOS Engine
recipe: engine/engine

View File

@ -41,6 +41,8 @@ if [ ! -f "$COMPILE_COMMANDS" ]; then
(cd "$SRC_DIR"; ./flutter/tools/gn)
fi
echo "$(date +%T) Running clang_tidy"
cd "$SCRIPT_DIR"
"$DART" \
--disable-dart-dev \
@ -49,9 +51,13 @@ cd "$SCRIPT_DIR"
--mac-host-warnings-as-errors="$MAC_HOST_WARNINGS_AS_ERRORS" \
"$@"
echo "$(date +%T) Running pylint"
cd "$FLUTTER_DIR"
pylint-2.7 --rcfile=.pylintrc \
"build/" \
"ci/" \
"impeller/" \
"tools/gn"
echo "$(date +%T) Linting complete"