Skip to content

Commit ead0ef8

Browse files
check: Add suite l10n
1 parent 4771575 commit ead0ef8

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

tools/check

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ this_dir=${BASH_SOURCE[0]%/*}
2626

2727
default_suites=(
2828
analyze test
29-
build_runner drift pigeon icons
29+
l10n build_runner drift pigeon icons
3030
android # This takes multiple minutes in CI, so do it last.
3131
)
3232

@@ -82,7 +82,7 @@ while (( $# )); do
8282
--all) opt_files=all; opt_all=1; shift;;
8383
--fix) opt_fix=1; shift;;
8484
--verbose) opt_verbose=1; shift;;
85-
analyze|test|build_runner|drift|pigeon|icons|android|shellcheck)
85+
analyze|test|l10n|build_runner|drift|pigeon|icons|android|shellcheck)
8686
opt_suites+=("$1"); shift;;
8787
*) usage;;
8888
esac
@@ -241,6 +241,21 @@ should_run_build_runner() {
241241
return 1
242242
}
243243

244+
run_l10n() {
245+
local output_path=lib/generated/l10n
246+
247+
files_check "${output_path}"/'*'.dart \
248+
|| return 0
249+
250+
check_no_uncommitted_or_untracked "${output_path}"/'*'.dart \
251+
|| return
252+
253+
flutter gen-l10n > /dev/null \
254+
|| return
255+
256+
check_no_changes "updates to l10n" "${output_path}"/'*'.dart
257+
}
258+
244259
run_build_runner() {
245260
should_run_build_runner \
246261
|| return 0
@@ -443,6 +458,7 @@ for suite in "${opt_suites[@]}"; do
443458
case "$suite" in
444459
analyze) run_analyze ;;
445460
test) run_test ;;
461+
l10n) run_l10n ;;
446462
build_runner) run_build_runner ;;
447463
drift) run_drift ;;
448464
pigeon) run_pigeon ;;

0 commit comments

Comments
 (0)