Repository navigation
[cli_util, process] Fix new lints and platform deprecations - #2716
Conversation
- Update `pkgs/cli_util` to call `doneCompleter.complete()` without redundant `null` arguments and ignore `avoid_redundant_argument_values` on `maxVisibleItems: 5` in `select_dialog_test.dart` for Dart `3.15.0-dev`. - Ignore `deprecated_member_use` in `pkgs/process` (`common.dart` and `common_test.dart`) for `package:platform` `3.2.0` deprecations and bump `process` to `5.0.7-wip`.
There was a problem hiding this comment.
Code Review
This pull request simplifies the doneCompleter.complete() calls in select_dialog.dart, adds lint suppressions for deprecated member usage in pkgs/process, and bumps the package version to 5.0.7-wip. Feedback on the changes suggests removing the redundant maxVisibleItems: 5 argument in select_dialog_test.dart entirely rather than adding an ignore comment for avoid_redundant_argument_values.
| inputController.stream, | ||
| maxVisibleItems: 5, | ||
| maxVisibleItems: 5, // ignore: avoid_redundant_argument_values |
There was a problem hiding this comment.
Instead of adding an ignore comment for avoid_redundant_argument_values, you can simply omit the redundant maxVisibleItems: 5 argument entirely. Since 5 is already the default value for maxVisibleItems in both showMultiSelectDialog and showSingleSelectDialog, omitting it keeps the test code cleaner and avoids the need for lint suppression.
| inputController.stream, | |
| maxVisibleItems: 5, | |
| maxVisibleItems: 5, // ignore: avoid_redundant_argument_values | |
| inputController.stream, |
There was a problem hiding this comment.
Where do we have this lint enabled? I'm iffy on it...
There was a problem hiding this comment.
It was only enabled in pkgs/cli_util/analysis_options.yaml#L15 (not in package:lints or package:dart_flutter_team_lints). Removed it from analysis_options.yaml and dropped the // ignore: avoid_redundant_argument_values comments in select_dialog_test.dart.
PR Health
|
…ns.yaml - Drop `avoid_redundant_argument_values` from `pkgs/cli_util/analysis_options.yaml` and remove the `// ignore: avoid_redundant_argument_values` comments in `pkgs/cli_util/test/select_dialog_test.dart`.
| // Handle Ctrl+C and abort the dialog. | ||
| final sigintSub = ProcessSignal.sigint.watch().listen((_) { | ||
| if (!doneCompleter.isCompleted) { | ||
| doneCompleter.complete(null); |
There was a problem hiding this comment.
I want the null.
I want (eventually) to make the parameter not be optional. It's bad API that you can always omit an argument, but it's a runtime error if the type parameter isn't nullable.
Unblocks CI on
main(and Dependabot PR #2714) against Dart3.15.0-devandpackage:platform3.2.0:package:cli_util: Removeavoid_redundant_argument_valuesfrom analysis_options.yaml (along with its// ignore:comments in select_dialog_test.dart) and omit redundantnullarguments indoneCompleter.complete()(select_dialog.dart).package:process: Ignoredeprecated_member_useincommon.dartandcommon_test.dartforpackage:platform3.2.0(LocalPlatform,FakePlatform,operatingSystem,environment) sodart analyze --fatal-infospasses while keepingplatform: '^3.0.0'compatibility.