From 64982f895e2b67e705c657207a59c8340ccca43f Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Mon, 17 Jun 2024 09:53:49 -0500 Subject: [PATCH] Update to package:lints v4 (#3785) --- analysis_options.yaml | 1 - lib/dartdoc.dart | 2 +- lib/src/dartdoc_options.dart | 4 +--- lib/src/experiment_options.dart | 4 +--- lib/src/generator/generator.dart | 2 +- lib/src/generator/resource_loader.dart | 2 +- lib/src/generator/templates.dart | 2 +- lib/src/io_utils.dart | 2 +- lib/src/markdown_processor.dart | 2 +- lib/src/model/comment_referable.dart | 4 +--- lib/src/model/model_element.dart | 2 +- lib/src/source_linker.dart | 2 +- pubspec.yaml | 2 +- test/warnings_test.dart | 2 +- 14 files changed, 13 insertions(+), 20 deletions(-) diff --git a/analysis_options.yaml b/analysis_options.yaml index c276ee3f67..e0c48b41c8 100644 --- a/analysis_options.yaml +++ b/analysis_options.yaml @@ -26,7 +26,6 @@ linter: - dangling_library_doc_comments - directives_ordering - invalid_case_patterns - - library_annotations - no_adjacent_strings_in_list - no_literal_bool_comparisons - omit_local_variable_types diff --git a/lib/dartdoc.dart b/lib/dartdoc.dart index d7cacc8d21..b11f573ca2 100644 --- a/lib/dartdoc.dart +++ b/lib/dartdoc.dart @@ -4,7 +4,7 @@ /// A documentation generator for Dart. @Deprecated('Will be removed in a later version of DartDoc.') -library dartdoc; +library; export 'package:dartdoc/src/dartdoc.dart'; export 'package:dartdoc/src/dartdoc_options.dart'; diff --git a/lib/src/dartdoc_options.dart b/lib/src/dartdoc_options.dart index 5b47f2c6cf..237944cbc0 100644 --- a/lib/src/dartdoc_options.dart +++ b/lib/src/dartdoc_options.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -/// /// dartdoc's dartdoc_options.yaml configuration file follows similar loading /// semantics to that of analysis_options.yaml, /// [documented here](https://dart.dev/guides/language/analysis-options). @@ -11,8 +10,7 @@ /// /// The classes here manage both the dartdoc_options.yaml loading and command /// line arguments. -/// -library dartdoc.dartdoc_options; +library; import 'dart:io' show Platform, exitCode, stderr, stdout; diff --git a/lib/src/experiment_options.dart b/lib/src/experiment_options.dart index 281f6c60dc..27b44b7d6e 100644 --- a/lib/src/experiment_options.dart +++ b/lib/src/experiment_options.dart @@ -2,11 +2,9 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -/// /// Implementation of Dart language experiment option handling for dartdoc. /// See https://github.com/dart-lang/sdk/blob/main/docs/process/experimental-flags.md. -/// -library dartdoc.experiment_options; +library; import 'package:analyzer/file_system/file_system.dart'; // ignore: implementation_imports diff --git a/lib/src/generator/generator.dart b/lib/src/generator/generator.dart index d251536b41..a97d81c353 100644 --- a/lib/src/generator/generator.dart +++ b/lib/src/generator/generator.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// A library containing an abstract documentation generator. -library dartdoc.generator; +library; import 'package:analyzer/file_system/file_system.dart'; import 'package:dartdoc/src/dartdoc_options.dart'; diff --git a/lib/src/generator/resource_loader.dart b/lib/src/generator/resource_loader.dart index d5de3f2a04..70b0a1094d 100644 --- a/lib/src/generator/resource_loader.dart +++ b/lib/src/generator/resource_loader.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// Make it possible to load resources from the dartdoc code repository. -library dartdoc.resource_loader; +library; import 'dart:convert' show utf8; import 'dart:isolate' show Isolate; diff --git a/lib/src/generator/templates.dart b/lib/src/generator/templates.dart index cba63f6773..4bfe34c17d 100644 --- a/lib/src/generator/templates.dart +++ b/lib/src/generator/templates.dart @@ -35,7 +35,7 @@ @Renderer(#renderTopLevelProperty, Context(), 'top_level_property') @Renderer(#renderTypedef, Context(), 'typedef') -library dartdoc.templates; +library; import 'package:analyzer/file_system/file_system.dart'; import 'package:dartdoc/src/dartdoc_options.dart'; diff --git a/lib/src/io_utils.dart b/lib/src/io_utils.dart index 23e5f23d14..348df1c38e 100644 --- a/lib/src/io_utils.dart +++ b/lib/src/io_utils.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// This is a helper library to make working with io easier. -library dartdoc.io_utils; +library; import 'dart:async'; import 'dart:collection'; diff --git a/lib/src/markdown_processor.dart b/lib/src/markdown_processor.dart index e6405aafeb..509e880a59 100644 --- a/lib/src/markdown_processor.dart +++ b/lib/src/markdown_processor.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// Utility code to convert Markdown comments to HTML. -library dartdoc.markdown_processor; +library; import 'dart:convert'; import 'dart:math'; diff --git a/lib/src/model/comment_referable.dart b/lib/src/model/comment_referable.dart index ba8fac49d5..feb12902c6 100644 --- a/lib/src/model/comment_referable.dart +++ b/lib/src/model/comment_referable.dart @@ -2,10 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -/// /// Code for managing comment reference lookups in dartdoc. -/// -library dartdoc.src.model.comment_reference; +library; import 'dart:core'; diff --git a/lib/src/model/model_element.dart b/lib/src/model/model_element.dart index 58d557ca7c..1851354172 100644 --- a/lib/src/model/model_element.dart +++ b/lib/src/model/model_element.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// The models used to represent Dart code. -library dartdoc.models; +library; import 'dart:convert'; diff --git a/lib/src/source_linker.dart b/lib/src/source_linker.dart index f5525e50fa..2166d4badb 100644 --- a/lib/src/source_linker.dart +++ b/lib/src/source_linker.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// A library for getting external source code links for Dartdoc. -library dartdoc.source_linker; +library; import 'package:analyzer/file_system/file_system.dart'; import 'package:dartdoc/src/dartdoc_options.dart'; diff --git a/pubspec.yaml b/pubspec.yaml index ffd41acc3c..20da197756 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -26,7 +26,7 @@ dependencies: dev_dependencies: async: ^2.11.0 dart_style: ^2.3.4 - lints: ^3.0.0 + lints: ^4.0.0 matcher: ^0.12.15 test: ^1.24.2 test_descriptor: ^2.0.1 diff --git a/test/warnings_test.dart b/test/warnings_test.dart index 0d2b293163..6587ddf469 100644 --- a/test/warnings_test.dart +++ b/test/warnings_test.dart @@ -3,7 +3,7 @@ // BSD-style license that can be found in the LICENSE file. /// Unit tests for lib/src/warnings.dart. -library dartdoc.warnings_test; +library; import 'package:analyzer/file_system/physical_file_system.dart'; import 'package:dartdoc/src/dartdoc_options.dart';