Skip to content

Commit bca0682

Browse files
authored
[macros] Fix for analyzer presubmit. (#3856)
1 parent ff9eb44 commit bca0682

File tree

4 files changed

+24
-6
lines changed

4 files changed

+24
-6
lines changed

.github/workflows/dart.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- name: dart pub get (working/macros/example)
2424
run: dart pub get
2525
working-directory: working/macros/example
26+
- name: dart pub get (working/macros/dart_model)
27+
run: testing/pub_get
28+
working-directory: working/macros/dart_model
2629
- name: dart pub get (accepted/2.3/spread-collections/benchmarks)
2730
run: dart pub get
2831
working-directory: accepted/2.3/spread-collections/benchmarks

working/macros/dart_model/testing/presubmit

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,16 @@
22

33
set -e
44

5+
testing/pub_get
6+
57
# Analyze, format and test packages.
68
for package in dart_model dart_model_analyzer_service dart_model_repl \
79
macro_client macro_host macro_protocol testing/scratch \
810
testing/benchmark testing/test_macro_annotations testing/test_macros; do
911
pushd "$package"
10-
dart pub get
11-
12-
# Skip analyzing packages that need augmentations to be generated.
13-
if ! grep -qr 'import augment' lib; then
14-
dart analyze --fatal-infos
15-
fi
12+
dart analyze --fatal-infos
1613

14+
# Help dartfmt by removing augmentation files and imports.
1715
# Delete augmentation files.
1816
find . -name \*.a.dart | xargs --no-run-if-empty rm
1917
# Remove augmentation imports.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash --
2+
3+
set -e
4+
5+
for package in dart_model dart_model_analyzer_service dart_model_repl \
6+
macro_client macro_host macro_protocol testing/scratch \
7+
testing/benchmark testing/test_macro_annotations testing/test_macros; do
8+
pushd "$package"
9+
dart pub get
10+
popd
11+
done
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
include: ../../analysis_options.yaml
2+
3+
analyzer:
4+
errors:
5+
# If the augmenation file hasn't been generated.
6+
uri_does_not_exist: ignore

0 commit comments

Comments
 (0)