File tree Expand file tree Collapse file tree 14 files changed +32
-28
lines changed Expand file tree Collapse file tree 14 files changed +32
-28
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ analyzer:
44 errors :
55 # Disable implementation_imports.
66 implementation_imports : ignore
7+ language :
8+ strict-raw-types : true
79
810linter :
911 rules :
Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ class AnalysisServer {
290290 _streamController (event).add (params.cast <String , dynamic >());
291291 }
292292 } else if (response case {'id' : final String id}) {
293- if (response case {'error' : final Map error}) {
293+ if (response case {'error' : final Map < String , Object ?> error}) {
294294 _requestCompleters.remove (id)? .completeError (
295295 RequestError .parse (error.cast <String , dynamic >()));
296296 } else {
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ abstract class DartdevCommand extends Command<int> {
7171 ArgParser (usageLineLength: dartdevUsageLineLength);
7272}
7373
74- extension DartDevCommand on Command {
74+ extension DartDevCommand < T > on Command < T > {
7575 /// Return whether commands should emit verbose output.
7676 bool get verbose => globalResults! .flag ('verbose' );
7777
@@ -105,7 +105,7 @@ Future<int> runProcess(
105105 void Function (String str)? listener,
106106 String ? cwd,
107107}) async {
108- Future forward (Stream <List <int >> output, bool isStderr) {
108+ Future < void > forward (Stream <List <int >> output, bool isStderr) {
109109 return _streamLineTransform (output, (line) {
110110 final trimmed = line.trimRight ();
111111 logToTrace
@@ -129,7 +129,7 @@ Future<int> runProcess(
129129 return exitCode;
130130}
131131
132- Future _streamLineTransform (
132+ Future < void > _streamLineTransform (
133133 Stream <List <int >> stream,
134134 Function (String line) handler,
135135) {
Original file line number Diff line number Diff line change @@ -34,9 +34,8 @@ class DDSRunner {
3434 if (! isAot) {
3535 // On ia32 sdks we do not have an AOT runtime and so we would be
3636 // using the regular executable.
37- snapshotName = fullSdk
38- ? sdk.ddsSnapshot
39- : absolute (sdkDir, 'dds.dart.snapshot' );
37+ snapshotName =
38+ fullSdk ? sdk.ddsSnapshot : absolute (sdkDir, 'dds.dart.snapshot' );
4039 if (! Sdk .checkArtifactExists (snapshotName)) {
4140 return false ;
4241 }
@@ -64,7 +63,7 @@ class DDSRunner {
6463 const devToolsMessagePrefix =
6564 'The Dart DevTools debugger and profiler is available at:' ;
6665 if (debugDds) {
67- late final StreamSubscription stdoutSub;
66+ late final StreamSubscription < String > stdoutSub;
6867 stdoutSub = process.stdout
6968 .transform (utf8.decoder)
7069 .transform (const LineSplitter ())
Original file line number Diff line number Diff line change @@ -16,11 +16,13 @@ import 'package:unified_analytics/unified_analytics.dart';
1616import 'experiment_util.dart' ;
1717import 'utils.dart' ;
1818
19- List <Map > extractAnalytics (io.ProcessResult result) {
19+ List <Map < String , Object ?> > extractAnalytics (io.ProcessResult result) {
2020 return LineSplitter .split (result.stderr)
2121 .where ((line) => line.startsWith ('[analytics]: ' ))
22- .map ((line) => json.decode (line.substring ('[analytics]: ' .length)) as Map )
23- .toList ();
22+ .map ((line) {
23+ return (json.decode (line.substring ('[analytics]: ' .length)) as Map )
24+ .cast <String , Object ?>();
25+ }).toList ();
2426}
2527
2628void main () {
Original file line number Diff line number Diff line change @@ -122,8 +122,8 @@ void defineCreateTests() {
122122
123123 if (isLastCommand && (isServerTemplate || isWebTemplate)) {
124124 final completer = Completer <void >();
125- late StreamSubscription stdoutSub;
126- late StreamSubscription stderrSub;
125+ late final StreamSubscription < String > stdoutSub;
126+ late final StreamSubscription < String > stderrSub;
127127 // Listen for well-known output from specific templates to determine
128128 // if they've executed correctly. These templates won't exit on their
129129 // own, so we'll need to terminate the process once we've verified it
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ void devtools() {
7979 final devToolsServedCompleter = Completer <void >();
8080 final dtdServedCompleter = Completer <void >();
8181
82- late StreamSubscription sub;
82+ late final StreamSubscription < String > sub;
8383 sub = process! .stdout
8484 .transform <String >(utf8.decoder)
8585 .transform <String >(const LineSplitter ())
@@ -157,7 +157,7 @@ void devtools() {
157157 bool startedDds = false ;
158158 bool startedDtd = false ;
159159 final devToolsServedCompleter = Completer <void >();
160- late StreamSubscription sub;
160+ late final StreamSubscription < String > sub;
161161 sub = process.stdout
162162 .transform <String >(utf8.decoder)
163163 .transform <String >(const LineSplitter ())
@@ -228,7 +228,7 @@ Future<void> main() async {
228228 );
229229
230230 final serviceUriCompleter = Completer <String >();
231- late StreamSubscription sub;
231+ late final StreamSubscription < String > sub;
232232 sub = targetProjectInstance! .stdout
233233 .transform (utf8.decoder)
234234 .transform (const LineSplitter ())
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ void command() {
3333 test ('description formatting' , () {
3434 DartdevRunner (['--suppress-analytics' ])
3535 .commands
36- .forEach ((String commandKey, Command command) {
36+ .forEach ((String commandKey, Command < int > command) {
3737 expect (commandKey, isNotEmpty);
3838 expect (command.description, isNotEmpty);
3939 expect (command.description.split ('\n ' ).first, endsWith ('.' ));
@@ -45,7 +45,7 @@ void command() {
4545 test ('argParser usageLineLength' , () {
4646 DartdevRunner (['--suppress-analytics' ])
4747 .commands
48- .forEach ((String commandKey, Command command) {
48+ .forEach ((String commandKey, Command < int > command) {
4949 if (command.name != 'help' &&
5050 command.name != 'format' &&
5151 command.name != 'pub' &&
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ void help() {
2222 ];
2323 DartdevRunner (['--suppress-analytics' ])
2424 .commands
25- .forEach ((String commandKey, Command command) {
25+ .forEach ((String commandKey, Command < int > command) {
2626 if (! commandsNotTested.contains (commandKey)) {
2727 test ('(help $commandKey == $commandKey --help)' , () async {
2828 p = project ();
@@ -57,7 +57,7 @@ void help() {
5757 test ('(--help flags also have -h abbr)' , () {
5858 DartdevRunner (['--suppress-analytics' ])
5959 .commands
60- .forEach ((String commandKey, Command command) {
60+ .forEach ((String commandKey, Command < int > command) {
6161 var helpOption = command.argParser.options['help' ];
6262 // Some commands (like pub which use
6363 // "argParser = ArgParser.allowAnything()") may not have the help Option
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ void defineLanguageServerTests() {
2727 late utils.TestProject project;
2828 Process ? process;
2929
30- Future runWithLsp (List <String > args) async {
30+ Future < void > runWithLsp (List <String > args) async {
3131 project = utils.project ();
3232
3333 process = await project.start (args);
You can’t perform that action at this time.
0 commit comments