mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	Fix indentation
This commit is contained in:
		| @ -1,54 +1,54 @@ | ||||
| #!/usr/bin/env bash -xe | ||||
|  | ||||
| if [[ $(flutter format -n .) ]]; then | ||||
|     echo "flutter format issue" | ||||
|     exit 1 | ||||
|   echo "flutter format issue" | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| flutter pub get | ||||
| result=$(dartanalyzer lib/) | ||||
| if ! echo "$result" | grep -q "No issues found!"; then | ||||
|     echo "$result" | ||||
|     echo "dartanalyzer issue: lib" | ||||
|     exit 1 | ||||
|   echo "$result" | ||||
|   echo "dartanalyzer issue: lib" | ||||
|   exit 1 | ||||
| fi | ||||
|  | ||||
| analyzer() { | ||||
|     cd $1 | ||||
|     flutter pub get | ||||
|     result=$(dartanalyzer .) | ||||
|     if ! echo "$result" | grep -q "No issues found!"; then | ||||
|         echo "$result" | ||||
|         echo "dartanalyzer issue: $1" | ||||
|         exit 1 | ||||
|     fi | ||||
|     cd - > /dev/null | ||||
|   cd $1 | ||||
|   flutter pub get | ||||
|   result=$(dartanalyzer .) | ||||
|   if ! echo "$result" | grep -q "No issues found!"; then | ||||
|     echo "$result" | ||||
|     echo "dartanalyzer issue: $1" | ||||
|     exit 1 | ||||
|   fi | ||||
|   cd - > /dev/null | ||||
| } | ||||
|  | ||||
| analyzer "example" | ||||
|  | ||||
| #  Examples that are changed | ||||
| changed=$(git diff --name-only develop... doc/examples \ | ||||
|     | xargs -I {} dirname {} | sed 's/\/lib$//' | uniq \ | ||||
|     | xargs -I {} find {} -name pubspec.yaml | xargs -I {} dirname {}) | ||||
|   | xargs -I {} dirname {} | sed 's/\/lib$//' | uniq \ | ||||
|   | xargs -I {} find {} -name pubspec.yaml | xargs -I {} dirname {}) | ||||
|  | ||||
| # Examples that are affected by changed code | ||||
| affected=$(git diff --name-only develop... lib/ \ | ||||
|     | xargs -I {} basename {} | xargs -I {} grep -r -l --include \*.dart {} doc/examples/ \ | ||||
|     | xargs -I {} dirname {} | sed 's/\/lib$//' | uniq \ | ||||
|     | xargs -I {} find {} -name pubspec.yaml | xargs -I {} dirname {}) | ||||
|   | xargs -I {} basename {} | xargs -I {} grep -r -l --include \*.dart {} doc/examples/ \ | ||||
|   | xargs -I {} dirname {} | sed 's/\/lib$//' | uniq \ | ||||
|   | xargs -I {} find {} -name pubspec.yaml | xargs -I {} dirname {}) | ||||
|  | ||||
| both=("${changed[@]}" "${affected[@]}") | ||||
| lint_examples=$(printf "%s\n" "${both[@]}" | sort -u) | ||||
| for d in $lint_examples; do | ||||
|     analyzer $d | ||||
|   analyzer $d | ||||
| done | ||||
|  | ||||
| for f in doc/examples/**/pubspec.yaml; do | ||||
|     d=$(dirname $f) | ||||
|     if [[ ! " ${lint_examples[@]} " =~ " ${d} " ]]; then | ||||
|         analyzer $d | ||||
|     fi | ||||
|   d=$(dirname $f) | ||||
|   if [[ ! " ${lint_examples[@]} " =~ " ${d} " ]]; then | ||||
|     analyzer $d | ||||
|   fi | ||||
| done | ||||
|  | ||||
| echo "success" | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Lukas Klingsbo
					Lukas Klingsbo