diff --git a/pkg/analyzer/analysis_options.yaml b/pkg/analyzer/analysis_options.yaml index b3b582bb770..6173ec229fe 100644 --- a/pkg/analyzer/analysis_options.yaml +++ b/pkg/analyzer/analysis_options.yaml @@ -9,26 +9,34 @@ analyzer: # still reported. Re-evaluate after # https://github.com/dart-lang/language/pull/599 and a functional fix land. inference_failure_on_untyped_parameter: ignore - # There are about 10k violations in test/ due to missing return types on - # test methods. It would be nice to mark this code as - # "ignored for test/**/*.dart". - inference_failure_on_function_return_type: ignore # Lints from the recommended set that conflict w/ analyzer style or will # require some work to reach compliance. # See: https://github.com/dart-lang/sdk/issues/48784 avoid_renaming_method_parameters: ignore - # We sometimes name test classes with an underscore, and have a consistent - # practice of doing so. We do not have an problems of naming classes with - # snake_case, so we're not missing much by disabling it. Re-enable when we - # can ignore a lint rule for a certain path. - camel_case_types: ignore + + # More than 500 violations in lib/. constant_identifier_names: ignore + + # About 10 violations in lib/. hash_and_equals: ignore + + # More than 500 violations in lib/. non_constant_identifier_names: ignore + + # This package imports much of the implementation libraries of the + # '_fe_analyzer_shared' package, because it is tightly integrated. This + # will not likely change any time soon. implementation_imports: ignore + + # About 20 violations of this in lib/. library_private_types_in_public_api: ignore + + # About 30 violations of this in lib/. provide_deprecation_message: ignore + + # Ignoring this for all developers means developers don't need to ignore + # TODOs in their IDE settings. todo: ignore language: diff --git a/pkg/analyzer/lib/src/dart/element/element.dart b/pkg/analyzer/lib/src/dart/element/element.dart index e2114c10da1..9d5c456a97e 100644 --- a/pkg/analyzer/lib/src/dart/element/element.dart +++ b/pkg/analyzer/lib/src/dart/element/element.dart @@ -6113,6 +6113,8 @@ class ParameterElementImpl extends VariableElementImpl } /// The parameter of an implicit setter. +// Pre-existing name. +// ignore: camel_case_types class ParameterElementImpl_ofImplicitSetter extends ParameterElementImpl { final PropertyAccessorElementImpl_ImplicitSetter setter; @@ -6454,6 +6456,8 @@ class PropertyAccessorElementImpl extends ExecutableElementImpl } /// Implicit getter for a [PropertyInducingElementImpl]. +// Pre-existing name. +// ignore: camel_case_types class PropertyAccessorElementImpl_ImplicitGetter extends PropertyAccessorElementImpl { /// Create the implicit getter and bind it to the [property]. @@ -6514,6 +6518,8 @@ class PropertyAccessorElementImpl_ImplicitGetter } /// Implicit setter for a [PropertyInducingElementImpl]. +// Pre-existing name. +// ignore: camel_case_types class PropertyAccessorElementImpl_ImplicitSetter extends PropertyAccessorElementImpl { /// Create the implicit setter and bind it to the [property]. diff --git a/pkg/analyzer/lib/src/generated/sdk.dart b/pkg/analyzer/lib/src/generated/sdk.dart index 7216741048e..1606f2bfde8 100644 --- a/pkg/analyzer/lib/src/generated/sdk.dart +++ b/pkg/analyzer/lib/src/generated/sdk.dart @@ -166,6 +166,8 @@ class SdkDescription { } } +// Pre-existing name. +// ignore: camel_case_types class SdkLibrariesReader_LibraryBuilder extends RecursiveAstVisitor { /// The prefix added to the name of a library to form the URI used in code to /// reference the library. diff --git a/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart b/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart index 3b1b774a93c..2dcf435ef99 100644 --- a/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart +++ b/pkg/analyzer/lib/src/summary2/ast_binary_writer.dart @@ -952,7 +952,7 @@ class AstBinaryWriter extends ThrowingAstVisitor { _writeStringReference(token.lexeme); } - _writeDouble(double value) { + void _writeDouble(double value) { _sink.addDouble(value); } diff --git a/pkg/analyzer/lib/src/summary2/macro_merge.dart b/pkg/analyzer/lib/src/summary2/macro_merge.dart index e43cc9845b1..8d823859834 100644 --- a/pkg/analyzer/lib/src/summary2/macro_merge.dart +++ b/pkg/analyzer/lib/src/summary2/macro_merge.dart @@ -37,7 +37,7 @@ class MacroElementsMerger { }); void perform({ - required Function() updateConstants, + required void Function() updateConstants, }) { _mergeClasses(); _mergeFunctions(); diff --git a/pkg/analyzer/lib/src/util/performance/operation_performance.dart b/pkg/analyzer/lib/src/util/performance/operation_performance.dart index 2d57ef7a7e4..d80ef268f74 100644 --- a/pkg/analyzer/lib/src/util/performance/operation_performance.dart +++ b/pkg/analyzer/lib/src/util/performance/operation_performance.dart @@ -54,6 +54,8 @@ abstract class OperationPerformanceDataImpl } } +// Pre-existing name. +// ignore: camel_case_types class OperationPerformanceDataImpl_int extends OperationPerformanceDataImpl { @override diff --git a/pkg/analyzer/test/analysis_options.yaml b/pkg/analyzer/test/analysis_options.yaml new file mode 100644 index 00000000000..dea8020281f --- /dev/null +++ b/pkg/analyzer/test/analysis_options.yaml @@ -0,0 +1,14 @@ +include: ../analysis_options.yaml + +analyzer: + errors: + # There are about 10k violations here due to missing return types on test + # methods. + inference_failure_on_function_return_type: ignore + + # We sometimes name test classes with an underscore, and have a consistent + # practice of doing so. We do not have an problems of naming classes with + # snake_case, so we're not missing much by disabling it. + camel_case_types: ignore + constant_identifier_names: ignore + non_constant_identifier_names: ignore diff --git a/pkg/analyzer/tool/analysis_driver/inspect_exception.dart b/pkg/analyzer/tool/analysis_driver/inspect_exception.dart index e0d467c7ba6..73890accac2 100644 --- a/pkg/analyzer/tool/analysis_driver/inspect_exception.dart +++ b/pkg/analyzer/tool/analysis_driver/inspect_exception.dart @@ -7,7 +7,7 @@ import 'dart:io'; import 'package:analyzer/src/summary/idl.dart'; import 'package:args/args.dart'; -main(List args) { +void main(List args) { ArgParser argParser = ArgParser()..addFlag('raw'); ArgResults argResults = argParser.parse(args); if (argResults.rest.length != 1) { diff --git a/pkg/analyzer/tool/experiments/experiments_test.dart b/pkg/analyzer/tool/experiments/experiments_test.dart index dc8e2aca174..b01c265b0d6 100644 --- a/pkg/analyzer/tool/experiments/experiments_test.dart +++ b/pkg/analyzer/tool/experiments/experiments_test.dart @@ -11,7 +11,7 @@ import 'generate.dart'; /// Check that all targets have been code generated. If they haven't tell the /// user to run `generate.dart`. -main() async { +void main() async { String script = Platform.script.toFilePath(windows: Platform.isWindows); List components = split(script); int index = components.indexOf('analyzer'); diff --git a/pkg/analyzer/tool/experiments/generate.dart b/pkg/analyzer/tool/experiments/generate.dart index 5c78d2c07c0..3304ccc220e 100644 --- a/pkg/analyzer/tool/experiments/generate.dart +++ b/pkg/analyzer/tool/experiments/generate.dart @@ -11,7 +11,7 @@ import 'package:analyzer_utilities/tools.dart'; import 'package:path/path.dart'; import 'package:yaml/yaml.dart' show YamlMap, loadYaml; -main() async { +void main() async { await GeneratedContent.generateAll( normalize(join(pkg_root.packageRoot, 'analyzer')), allTargets); } diff --git a/pkg/analyzer/tool/messages/extract_errors_to_yaml.dart b/pkg/analyzer/tool/messages/extract_errors_to_yaml.dart index 4925e4971ad..1ae165c67f2 100644 --- a/pkg/analyzer/tool/messages/extract_errors_to_yaml.dart +++ b/pkg/analyzer/tool/messages/extract_errors_to_yaml.dart @@ -24,7 +24,7 @@ import 'package:yaml/yaml.dart'; import 'error_code_info.dart'; -main() { +void main() { var errorDeclarations = _findErrorDeclarations(); var errorCodesByClass = _findErrorCodesByClass(); _generateYaml(errorCodesByClass, errorDeclarations); diff --git a/pkg/analyzer/tool/summary/check_test.dart b/pkg/analyzer/tool/summary/check_test.dart index a5d0473c966..d0478fc714e 100644 --- a/pkg/analyzer/tool/summary/check_test.dart +++ b/pkg/analyzer/tool/summary/check_test.dart @@ -10,7 +10,7 @@ import 'generate.dart'; /// Check that the target file has been code generated. If it hasn't tell the /// user to run generate.dart. -main() async { +void main() async { var idlFolderPath = normalize( join(package_root.packageRoot, 'analyzer', 'lib', 'src', 'summary')); var idlPath = normalize(join(idlFolderPath, 'idl.dart')); diff --git a/pkg/analyzer/tool/summary/generate.dart b/pkg/analyzer/tool/summary/generate.dart index 3df7ec2350b..c87d2726d23 100644 --- a/pkg/analyzer/tool/summary/generate.dart +++ b/pkg/analyzer/tool/summary/generate.dart @@ -26,7 +26,7 @@ import 'package:analyzer_utilities/tools.dart'; import 'idl_model.dart' as idl_model; import 'mini_ast.dart'; -main(List args) async { +void main(List args) async { if (args.length != 1) { print('Error: IDL path is required'); print('usage: dart generate.dart path/to/idl.dart'); diff --git a/pkg/analyzer/tool/test_log_parser/test_log_parser.dart b/pkg/analyzer/tool/test_log_parser/test_log_parser.dart index 735cd8ecafc..2dd0b215e31 100644 --- a/pkg/analyzer/tool/test_log_parser/test_log_parser.dart +++ b/pkg/analyzer/tool/test_log_parser/test_log_parser.dart @@ -6,7 +6,7 @@ import 'dart:io'; /// A simple command-line app that reads the content of a file containing the /// output from `test.py` and performs some simple analysis of it. -main(List args) async { +void main(List args) async { if (args.length != 1) { print('Usage: dart test_log_parser logFilePath'); return; diff --git a/pkg/analyzer/tool/update_id_tests.dart b/pkg/analyzer/tool/update_id_tests.dart index 44a93848bc9..d994568c761 100644 --- a/pkg/analyzer/tool/update_id_tests.dart +++ b/pkg/analyzer/tool/update_id_tests.dart @@ -4,7 +4,7 @@ import 'package:_fe_analyzer_shared/src/testing/id_testing.dart' as id; -main() async { +void main() async { await id.updateAllTests(idTests); } diff --git a/pkg/analyzer/tool/wolf/generate.dart b/pkg/analyzer/tool/wolf/generate.dart index 48b835c7f91..79c0c0e7c46 100644 --- a/pkg/analyzer/tool/wolf/generate.dart +++ b/pkg/analyzer/tool/wolf/generate.dart @@ -339,7 +339,7 @@ class _TrivialEncoding extends _Encoding { } extension on List { - forEachSeparated(void Function() separator, void Function(T) callback) { + void forEachSeparated(void Function() separator, void Function(T) callback) { void Function()? nextSeparator; for (var item in this) { nextSeparator?.call();