From 966d0ccebb7c0335da3b0496972cc3d677f2e99e Mon Sep 17 00:00:00 2001 From: Jenn Magder Date: Fri, 28 Oct 2022 11:20:09 -0700 Subject: [PATCH] Only run clang-tidy in presubmit when C, C++, ObjC, or ObjC++ files change (flutter/engine#36887) --- engine/src/flutter/.ci.yaml | 49 +++++++++++++++++++++++++++++++++++ engine/src/flutter/ci/lint.sh | 6 +++++ 2 files changed, 55 insertions(+) diff --git a/engine/src/flutter/.ci.yaml b/engine/src/flutter/.ci.yaml index bb3850ca0cd..bcd96105ef1 100644 --- a/engine/src/flutter/.ci.yaml +++ b/engine/src/flutter/.ci.yaml @@ -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 diff --git a/engine/src/flutter/ci/lint.sh b/engine/src/flutter/ci/lint.sh index 4e27f987690..00e31b85259 100755 --- a/engine/src/flutter/ci/lint.sh +++ b/engine/src/flutter/ci/lint.sh @@ -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"