Skip to content

Commit 8ab229f

Browse files
committed
Make the analyzer actually work.
Turns out that ignoring all error lines that match the empty string is a poor way to go. Also, we have to update all the example packages now too, since we analyze them. So just have travis use our update script. Also, remove flutter_tools' old travis stuff. It's now part of a bigger repo. Also, make travis use the dev Dart SDK, since we need the new analyzer. Stable is way too out of date, e.g. it still complains about libraries not having names and mixins using 'super', and the strong mode hints are even more aggressive than on dev.
1 parent 5109dd5 commit 8ab229f

File tree

5 files changed

+6
-34
lines changed

5 files changed

+6
-34
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: dart
22
sudo: false
33
dart:
4-
- stable
4+
- dev
55
addons:
66
apt:
77
sources:

packages/flutter_tools/lib/src/commands/analyze.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,8 @@ class AnalyzeCommand extends FlutterCommand {
140140

141141
// prepare a Dart file that references all the above Dart files
142142
StringBuffer mainBody = new StringBuffer();
143-
for (int index = 0; index < dartFiles.length; index += 1) {
143+
for (int index = 0; index < dartFiles.length; index += 1)
144144
mainBody.writeln('import \'${path.normalize(path.absolute(dartFiles[index]))}\' as file$index;');
145-
}
146145
mainBody.writeln('void main() { }');
147146

148147
// prepare a union of all the .packages files
@@ -243,8 +242,8 @@ class AnalyzeCommand extends FlutterCommand {
243242
new RegExp('^\\[error\\] Target of URI does not exist: \'dart:ui_internals\''), // https://github.com/flutter/flutter/issues/83
244243
new RegExp(r'\[lint\] Prefer using lowerCamelCase for constant names.'), // sometimes we have no choice (e.g. when matching other platforms)
245244
new RegExp(r'\[lint\] Avoid defining a one-member abstract class when a simple function will do.'), // too many false-positives; code review should catch real instances
246-
new RegExp(r'\[0-9]+ (error|warning|hint|lint).+found\.'),
247-
'',
245+
new RegExp(r'[0-9]+ (error|warning|hint|lint).+found\.'),
246+
new RegExp(r'^$'),
248247
];
249248

250249
RegExp generalPattern = new RegExp(r'^\[(error|warning|hint|lint)\] (.+) \(([^(),]+), line ([0-9]+), col ([0-9]+)\)$');

packages/flutter_tools/tool/travis.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

packages/unit/test/widget/widget_tester.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class WidgetTester {
144144
_dispatchEvent(p.up(), result);
145145
}
146146

147-
void fling(Element element, Offset offset, velocity, { int pointer: 1 }) {
147+
void fling(Element element, Offset offset, double velocity, { int pointer: 1 }) {
148148
flingFrom(getCenter(element), offset, velocity, pointer: pointer);
149149
}
150150

travis/setup.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,6 @@
11
#!/bin/bash
22
set -ex
33

4-
pub global activate tuneup
5-
6-
(cd packages/cassowary; pub get)
7-
(cd packages/flutter_sprites; pub get)
8-
(cd packages/flutter_tools; pub get)
9-
(cd packages/flx; pub get)
10-
(cd packages/newton; pub get)
11-
(cd packages/playfair; pub get)
12-
(cd packages/unit; pub get)
13-
(cd packages/updater; pub get)
4+
dart dev/update_packages.dart
145

156
./travis/download_tester.py packages/unit/packages/sky_engine/REVISION bin/cache/travis/out/Debug

0 commit comments

Comments
 (0)