This repository was archived by the owner on Feb 25, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ DART="${DART_BIN}/dart"
36
36
# to have this as an error.
37
37
MAC_HOST_WARNINGS_AS_ERRORS=" performance-move-const-arg,performance-unnecessary-value-param"
38
38
39
+ if [[ -z " ${FLUTTER_LINT_PRINT_FIX} " ]]; then
40
+ fix_flag=" "
41
+ else
42
+ fix_flag=" --fix"
43
+ fi
44
+
39
45
COMPILE_COMMANDS=" $SRC_DIR /out/host_debug/compile_commands.json"
40
46
if [ ! -f " $COMPILE_COMMANDS " ]; then
41
47
(cd " $SRC_DIR " ; ./flutter/tools/gn)
@@ -47,7 +53,18 @@ cd "$SCRIPT_DIR"
47
53
" $SRC_DIR /flutter/tools/clang_tidy/bin/main.dart" \
48
54
--src-dir=" $SRC_DIR " \
49
55
--mac-host-warnings-as-errors=" $MAC_HOST_WARNINGS_AS_ERRORS " \
50
- " $@ "
56
+ $fix_flag \
57
+ " $@ " && true # errors ignored
58
+ clang_tidy_return=$?
59
+ if [ $clang_tidy_return -ne 0 ]; then
60
+ if [ -n " $fix_flag " ]; then
61
+ echo " ###################################################"
62
+ echo " # Attempted to fix issues with the following patch:"
63
+ echo " ###################################################"
64
+ git --no-pager diff
65
+ fi
66
+ exit $clang_tidy_return
67
+ fi
51
68
52
69
cd " $FLUTTER_DIR "
53
70
pylint-2.7 --rcfile=.pylintrc \
You can’t perform that action at this time.
0 commit comments