[style] Enable `dangling_library_doc_comments` lint (#809)
It looks like the pub scoring system enforces a new lint: https://pub.dev/packages/ffigen/score
diff --git a/pkgs/ffigen/analysis_options.yaml b/pkgs/ffigen/analysis_options.yaml
index 8c036c9..80574fd 100644
--- a/pkgs/ffigen/analysis_options.yaml
+++ b/pkgs/ffigen/analysis_options.yaml
@@ -8,7 +8,7 @@
exclude:
- 'test/**_expected*'
# Goldens cannot be generated outside MacOS causing analysis errors.
- - test/native_objc_test/**
+ - test/native_objc_test/**
language:
strict-casts: true
strict-inference: true
@@ -16,10 +16,11 @@
linter:
rules:
# Enabled.
+ dangling_library_doc_comments: true
directives_ordering: true
prefer_final_locals: true
prefer_final_in_for_each: true
use_super_parameters: true
-
+
# Disabled.
constant_identifier_names: false
diff --git a/pkgs/ffigen/lib/src/config_provider/config.dart b/pkgs/ffigen/lib/src/config_provider/config.dart
index 5109a0c..d47e30e 100644
--- a/pkgs/ffigen/lib/src/config_provider/config.dart
+++ b/pkgs/ffigen/lib/src/config_provider/config.dart
@@ -2,7 +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.
-/// Validates the yaml input by the user, prints useful info for the user
+/// Validates the yaml input by the user, prints useful info for the user.
+library;
import 'dart:io';
diff --git a/pkgs/ffigen/lib/src/config_provider/config_types.dart b/pkgs/ffigen/lib/src/config_provider/config_types.dart
index a4cf142..ce68051 100644
--- a/pkgs/ffigen/lib/src/config_provider/config_types.dart
+++ b/pkgs/ffigen/lib/src/config_provider/config_types.dart
@@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
/// Contains all the neccesary classes required by config.
+library;
+
import 'dart:io';
import 'package:ffigen/src/code_generator.dart';
diff --git a/pkgs/ffigen/lib/src/config_provider/path_finder.dart b/pkgs/ffigen/lib/src/config_provider/path_finder.dart
index 715e1ac..5104410 100644
--- a/pkgs/ffigen/lib/src/config_provider/path_finder.dart
+++ b/pkgs/ffigen/lib/src/config_provider/path_finder.dart
@@ -3,6 +3,7 @@
// BSD-style license that can be found in the LICENSE file.
/// Utils for finding header paths on system.
+library;
import 'dart:io';
diff --git a/pkgs/ffigen/lib/src/header_parser/includer.dart b/pkgs/ffigen/lib/src/header_parser/includer.dart
index 5e55aa2..ebb7d3d 100644
--- a/pkgs/ffigen/lib/src/header_parser/includer.dart
+++ b/pkgs/ffigen/lib/src/header_parser/includer.dart
@@ -4,6 +4,7 @@
/// Utility functions to check whether a binding should be parsed or not
/// based on filters.
+library;
import '../config_provider/config_types.dart';
import '../strings.dart' as strings;
diff --git a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart
index 311c1e8..5eb7a02 100644
--- a/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart
+++ b/pkgs/ffigen/lib/src/header_parser/type_extractor/extractor.dart
@@ -3,6 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
/// Extracts code_gen Type from type.
+library;
+
import 'package:ffigen/src/code_generator.dart';
import 'package:ffigen/src/header_parser/sub_parsers/function_type_param_parser.dart';
import 'package:ffigen/src/header_parser/sub_parsers/typedefdecl_parser.dart';
diff --git a/pkgs/ffigen/test/native_test/build_test_dylib.dart b/pkgs/ffigen/test/native_test/build_test_dylib.dart
index a41f686..0eb9568 100644
--- a/pkgs/ffigen/test/native_test/build_test_dylib.dart
+++ b/pkgs/ffigen/test/native_test/build_test_dylib.dart
@@ -25,6 +25,7 @@
/// =======================================================================
/// =======================================================================
/// =======================================================================
+library;
import 'dart:io';
diff --git a/pkgs/jni/analysis_options.yaml b/pkgs/jni/analysis_options.yaml
index e591be8..5c89b58 100644
--- a/pkgs/jni/analysis_options.yaml
+++ b/pkgs/jni/analysis_options.yaml
@@ -7,6 +7,7 @@
linter:
rules:
+ - dangling_library_doc_comments
- prefer_final_locals
- prefer_const_declarations
# Additional information about this file can be found at
diff --git a/pkgs/jni/example/analysis_options.yaml b/pkgs/jni/example/analysis_options.yaml
index 7f0b15f..6d1a072 100644
--- a/pkgs/jni/example/analysis_options.yaml
+++ b/pkgs/jni/example/analysis_options.yaml
@@ -27,10 +27,10 @@
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
+ - dangling_library_doc_comments
- prefer_final_locals
- prefer_const_declarations
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/pkgs/jnigen/analysis_options.yaml b/pkgs/jnigen/analysis_options.yaml
index 4bebf0e..b32c3d0 100644
--- a/pkgs/jnigen/analysis_options.yaml
+++ b/pkgs/jnigen/analysis_options.yaml
@@ -12,6 +12,7 @@
linter:
rules:
+ - dangling_library_doc_comments
- prefer_final_locals
- prefer_const_declarations
- unawaited_futures
diff --git a/pkgs/jnigen/android_test_runner/analysis_options.yaml b/pkgs/jnigen/android_test_runner/analysis_options.yaml
index 61b6c4d..ca60bc6 100644
--- a/pkgs/jnigen/android_test_runner/analysis_options.yaml
+++ b/pkgs/jnigen/android_test_runner/analysis_options.yaml
@@ -22,8 +22,8 @@
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
+ - dangling_library_doc_comments
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/pkgs/jnigen/example/in_app_java/analysis_options.yaml b/pkgs/jnigen/example/in_app_java/analysis_options.yaml
index 61b6c4d..ca60bc6 100644
--- a/pkgs/jnigen/example/in_app_java/analysis_options.yaml
+++ b/pkgs/jnigen/example/in_app_java/analysis_options.yaml
@@ -22,8 +22,8 @@
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
+ - dangling_library_doc_comments
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/pkgs/jnigen/example/notification_plugin/example/analysis_options.yaml b/pkgs/jnigen/example/notification_plugin/example/analysis_options.yaml
index 61b6c4d..ca60bc6 100644
--- a/pkgs/jnigen/example/notification_plugin/example/analysis_options.yaml
+++ b/pkgs/jnigen/example/notification_plugin/example/analysis_options.yaml
@@ -22,8 +22,8 @@
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
+ - dangling_library_doc_comments
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/pkgs/jnigen/example/pdfbox_plugin/dart_example/analysis_options.yaml b/pkgs/jnigen/example/pdfbox_plugin/dart_example/analysis_options.yaml
index dee8927..17d13a8 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/dart_example/analysis_options.yaml
+++ b/pkgs/jnigen/example/pdfbox_plugin/dart_example/analysis_options.yaml
@@ -15,8 +15,9 @@
# Uncomment the following section to specify additional rules.
-# linter:
-# rules:
+linter:
+ rules:
+ - dangling_library_doc_comments
# - camel_case_types
# analyzer:
diff --git a/pkgs/jnigen/example/pdfbox_plugin/example/analysis_options.yaml b/pkgs/jnigen/example/pdfbox_plugin/example/analysis_options.yaml
index 61b6c4d..ca60bc6 100644
--- a/pkgs/jnigen/example/pdfbox_plugin/example/analysis_options.yaml
+++ b/pkgs/jnigen/example/pdfbox_plugin/example/analysis_options.yaml
@@ -22,8 +22,8 @@
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
+ - dangling_library_doc_comments
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule
-
# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
diff --git a/pkgs/native_assets_builder/analysis_options.yaml b/pkgs/native_assets_builder/analysis_options.yaml
index 89ab6f0..756a4a8 100644
--- a/pkgs/native_assets_builder/analysis_options.yaml
+++ b/pkgs/native_assets_builder/analysis_options.yaml
@@ -9,6 +9,7 @@
linter:
rules:
+ - dangling_library_doc_comments
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_in_for_each
diff --git a/pkgs/native_assets_cli/analysis_options.yaml b/pkgs/native_assets_cli/analysis_options.yaml
index dd3dcda..f69a864 100644
--- a/pkgs/native_assets_cli/analysis_options.yaml
+++ b/pkgs/native_assets_cli/analysis_options.yaml
@@ -6,6 +6,7 @@
linter:
rules:
+ - dangling_library_doc_comments
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_in_for_each
diff --git a/pkgs/native_toolchain_c/analysis_options.yaml b/pkgs/native_toolchain_c/analysis_options.yaml
index dd3dcda..f69a864 100644
--- a/pkgs/native_toolchain_c/analysis_options.yaml
+++ b/pkgs/native_toolchain_c/analysis_options.yaml
@@ -6,6 +6,7 @@
linter:
rules:
+ - dangling_library_doc_comments
- prefer_const_declarations
- prefer_expression_function_bodies
- prefer_final_in_for_each