From 2449098245c7d137bf9f01bb6ebb69cc2480324c Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Tue, 19 Sep 2023 09:15:29 -0700 Subject: [PATCH 1/3] Delete `ci/lint.sh`, which is no longer used. --- ci/lint.sh | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100755 ci/lint.sh diff --git a/ci/lint.sh b/ci/lint.sh deleted file mode 100755 index e7625fd7fdca1..0000000000000 --- a/ci/lint.sh +++ /dev/null @@ -1,35 +0,0 @@ -#!/bin/bash -# -# Copyright 2013 The Flutter Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -set -e - -# Needed because if it is set, cd may print the path it changed to. -unset CDPATH - -# On Mac OS, readlink -f doesn't work, so follow_links traverses the path one -# link at a time, and then cds into the link destination and find out where it -# ends up. -# -# The function is enclosed in a subshell to avoid changing the working directory -# of the caller. -function follow_links() ( - cd -P "$(dirname -- "$1")" - file="$PWD/$(basename -- "$1")" - while [[ -h "$file" ]]; do - cd -P "$(dirname -- "$file")" - file="$(readlink -- "$file")" - cd -P "$(dirname -- "$file")" - file="$PWD/$(basename -- "$file")" - done - echo "$file" -) - -SCRIPT_DIR=$(follow_links "$(dirname -- "${BASH_SOURCE[0]}")") -PYLINT="${SCRIPT_DIR}/pylint.sh" -CLANG_TIDY="${SCRIPT_DIR}/clang_tidy.sh" - -"${PYLINT}" "$@" -"${CLANG_TIDY}" "$@" From d17453bda2a72007cd60a4f180bf4155ed55dba5 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 20 Sep 2023 09:46:39 -0700 Subject: [PATCH 2/3] Update references to ci/lint.sh. --- .clang-tidy | 2 -- ci/builders/README.md | 10 +++++----- tools/githooks/README.md | 4 ++-- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index f6ee71473d917..b65d8f4336e1c 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,8 +1,6 @@ # A YAML format of https://clang.llvm.org/extra/clang-tidy/. # Prefix check with "-" to ignore. -# Note: Some of the checks here are used as errors selectively, see -# //ci/lint.sh Checks: >- bugprone-use-after-move, bugprone-unchecked-optional-access, diff --git a/ci/builders/README.md b/ci/builders/README.md index 645cc2d731ff5..c2ca7654110c1 100644 --- a/ci/builders/README.md +++ b/ci/builders/README.md @@ -448,7 +448,7 @@ Engine test example: { "tests": [ { - "name": "test: lint android_debug_arm64", + "name": "test: clang_tidy android_debug_arm64", "recipe": "engine_v2/tester_engine", "drone_dimensions": [ "device_type=none", @@ -460,7 +460,7 @@ Engine test example: ], "tasks": [ { - "name": "test: lint android_debug_arm64", + "name": "test: clang_tidy android_debug_arm64", "parameters": [ "--variant", "android_debug_arm64", @@ -469,7 +469,7 @@ Engine test example: "--shard-variants=host_debug" ], "max_attempts": 1, - "script": "flutter/ci/lint.sh" + "script": "flutter/ci/clang_tidy.sh" } ] } @@ -497,7 +497,7 @@ Example task configuration: ```json { - "name": "test: lint android_debug_arm64", + "name": "test: clang_tidy android_debug_arm64", "parameters": [ "--variant", "android_debug_arm64", @@ -506,7 +506,7 @@ Example task configuration: "--shard-variants=host_debug" ], "max_attempts": 1, - "script": "flutter/ci/lint.sh" + "script": "flutter/ci/clang_tidy.sh" } ``` diff --git a/tools/githooks/README.md b/tools/githooks/README.md index 1ac57c8ca3326..ce0ab06a24216 100644 --- a/tools/githooks/README.md +++ b/tools/githooks/README.md @@ -21,8 +21,8 @@ scripts have the names that `git` will look for. This hooks runs when pushing commits to a remote branch, for example to create or update a pull request: `git push origin my-local-branch`. -The `pre-push` hook runs `ci/lint.sh` and `ci/format.sh`. `ci/analyze.sh` and -`ci/licenses.sh` are more expensive and are not run. +The `pre-push` hook runs `ci/clang_tidy.sh`, `ci/pylint.sh` and `ci/format.sh`. +`ci/analyze.sh` and `ci/licenses.sh` are more expensive and are not run. ### Adding new pre-push checks From e91e336d24ba0af7527a2d81e9f2cedb09682f37 Mon Sep 17 00:00:00 2001 From: Matan Lurey Date: Wed, 20 Sep 2023 09:52:06 -0700 Subject: [PATCH 3/3] Tweak again. --- ci/clang_tidy.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ci/clang_tidy.sh b/ci/clang_tidy.sh index cacaebb62630a..80cb7030fbd55 100755 --- a/ci/clang_tidy.sh +++ b/ci/clang_tidy.sh @@ -36,10 +36,14 @@ DART="${DART_BIN}/dart" # FLUTTER_LINT_PRINT_FIX will make it so that fix is executed and the generated # diff is printed to stdout if clang-tidy fails. This is helpful for enabling # new lints. + +# To run on CI, just uncomment the following line: +# FLUTTER_LINT_PRINT_FIX=1 + if [[ -z "${FLUTTER_LINT_PRINT_FIX}" ]]; then fix_flag="" else - fix_flag="--fix" + fix_flag="--fix --lint-all" fi COMPILE_COMMANDS="$SRC_DIR/out/host_debug/compile_commands.json"