diff --git a/pkg/analyzer_cli/analysis_options.yaml b/pkg/analyzer_cli/analysis_options.yaml index ee6055a664c..e69ac71d34e 100644 --- a/pkg/analyzer_cli/analysis_options.yaml +++ b/pkg/analyzer_cli/analysis_options.yaml @@ -1,24 +1,19 @@ -include: package:pedantic/analysis_options.1.9.0.yaml +include: package:lints/recommended.yaml analyzer: strong-mode: implicit-casts: false - errors: - # Increase the severity of the unused_import hint. - unused_import: warning language: strict-inference: true exclude: - test/data/** + linter: rules: - - avoid_single_cascade_in_expression_statements - - avoid_unused_constructor_parameters - - await_only_futures - - empty_statements - - iterable_contains_unrelated_type - - list_remove_unrelated_type - - provide_deprecation_message - - unnecessary_brace_in_string_interps - - unnecessary_overrides - - void_checks + avoid_unused_constructor_parameters: true + directives_ordering: true + + # We import heavily from package:analyzer/src. + implementation_imports: false + # This rule does not work well with package:test_reflective_loader. + non_constant_identifier_names: false diff --git a/pkg/analyzer_cli/lib/src/driver.dart b/pkg/analyzer_cli/lib/src/driver.dart index 66b2f59d1d1..4ad11c96bec 100644 --- a/pkg/analyzer_cli/lib/src/driver.dart +++ b/pkg/analyzer_cli/lib/src/driver.dart @@ -171,7 +171,8 @@ class Driver implements CommandLineStarter { // Note: This references analysisDriver via closure, so it will change over // time during the following analysis. - var defaultSeverityProcessor = (AnalysisError error) { + SeverityProcessor defaultSeverityProcessor; + defaultSeverityProcessor = (AnalysisError error) { return determineProcessedSeverity( error, options, analysisDriver.analysisOptions); }; diff --git a/pkg/analyzer_cli/lib/src/perf_report.dart b/pkg/analyzer_cli/lib/src/perf_report.dart index c03212506df..25c21c5736d 100644 --- a/pkg/analyzer_cli/lib/src/perf_report.dart +++ b/pkg/analyzer_cli/lib/src/perf_report.dart @@ -8,7 +8,7 @@ import 'dart:io' show Platform; import 'package:analyzer_cli/src/error_formatter.dart'; import 'package:analyzer_cli/src/options.dart' show CommandLineOptions; -const _JSON = JsonEncoder.withIndent(' '); +const _jsonEncoder = JsonEncoder.withIndent(' '); final String _osType = () { if (Platform.isLinux) { @@ -53,5 +53,5 @@ String makePerfReport(int startTime, int endTime, CommandLineOptions options, 'reportedDiagnostics': stats.filteredCount, }; - return _JSON.convert(reportJson); + return _jsonEncoder.convert(reportJson); } diff --git a/pkg/analyzer_cli/pubspec.yaml b/pkg/analyzer_cli/pubspec.yaml index 9ad9601b39d..466e47728f8 100644 --- a/pkg/analyzer_cli/pubspec.yaml +++ b/pkg/analyzer_cli/pubspec.yaml @@ -19,6 +19,6 @@ dependencies: yaml: any dev_dependencies: - pedantic: ^1.9.0 + lints: any test_reflective_loader: ^0.1.8 test: ^1.0.0 diff --git a/tools/package_deps/bin/package_deps.dart b/tools/package_deps/bin/package_deps.dart index ad73069c23e..eab420139ad 100644 --- a/tools/package_deps/bin/package_deps.dart +++ b/tools/package_deps/bin/package_deps.dart @@ -247,9 +247,9 @@ class Package implements Comparable { var extraDevDeclarations = Set.from(_declaredDevDependencies) ..removeAll(devdeps); - // Remove package:pedantic as it is often declared as a dev dependency in - // order to bring in its analysis_options.yaml file. - extraDevDeclarations.remove('pedantic'); + // Remove package:pedantic and package:lints as they are often declared as + // dev dependencies in order to bring in their analysis_options.yaml files. + extraDevDeclarations.removeAll(['lints', 'pedantic']); if (extraDevDeclarations.isNotEmpty) { out(' ${_printSet(extraDevDeclarations)} declared in ' "'dev_dependencies:' but not used in dev dirs.");