Enable v1.9 pedantic lints...

...except for `omit_local_variable_types`

Change-Id: Ifd9ac78fedf99786a07b2cee5a3891378a49ef5d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151885
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jaime Wren <jwren@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
This commit is contained in:
Kevin Moore 2020-06-20 14:31:09 +00:00 committed by commit-bot@chromium.org
parent d46a696957
commit 762113758d
8 changed files with 15 additions and 9 deletions

View file

@ -1,4 +1,4 @@
include: package:pedantic/analysis_options.1.8.0.yaml
include: package:pedantic/analysis_options.1.9.0.yaml
analyzer:
errors:
@ -7,9 +7,11 @@ analyzer:
unused_import: warning
unnecessary_brace_in_string_interps: warning
# Ignore one pedantic lint
omit_local_variable_types: ignore
linter:
rules:
- directives_ordering
- prefer_relative_imports
- prefer_single_quotes
- unnecessary_brace_in_string_interps

View file

@ -105,9 +105,7 @@ void runDartdev(List<String> args) async {
stopwatch.stop();
// Set the exitCode, if it wasn't set in the catch block above.
if (exitCode == null) {
exitCode = result is int ? result : 0;
}
exitCode ??= result is int ? result : 0;
// Send analytics before exiting
if (analytics.enabled) {

View file

@ -13,6 +13,7 @@ import '../sdk.dart';
class PubCommand extends DartdevCommand<int> {
PubCommand({bool verbose = false}) : super('pub', 'Work with packages.');
@override
final ArgParser argParser = ArgParser.allowAnything();
@override

View file

@ -15,6 +15,7 @@ import '../sdk.dart';
import '../utils.dart';
class RunCommand extends DartdevCommand<int> {
@override
final ArgParser argParser = ArgParser.allowAnything();
final bool verbose;
RunCommand({this.verbose = false}) : super('run', '''

View file

@ -14,6 +14,7 @@ class TestCommand extends DartdevCommand<int> {
TestCommand({bool verbose = false})
: super('test', 'Runs tests in this project.');
@override
final ArgParser argParser = ArgParser.allowAnything();
@override

View file

@ -48,7 +48,7 @@ Future<Process> startProcess(
void routeToStdout(
Process process, {
bool logToTrace = false,
void listener(String str),
void Function(String str) listener,
}) {
if (isVerbose) {
_streamLineTransform(process.stdout, (String line) {
@ -72,7 +72,10 @@ void routeToStdout(
}
}
void _streamLineTransform(Stream<List<int>> stream, handler(String line)) {
void _streamLineTransform(
Stream<List<int>> stream,
Function(String line) handler,
) {
stream
.transform(utf8.decoder)
.transform(const LineSplitter())

View file

@ -20,4 +20,4 @@ dependencies:
dev_dependencies:
test: ^1.0.0
pedantic: ^1.8.0
pedantic: ^1.9.0

View file

@ -18,7 +18,7 @@ import 'core_test.dart' as core;
import 'sdk_test.dart' as sdk;
import 'utils_test.dart' as utils;
main() {
void main() {
group('dart', () {
analytics.main();
analyze.main();