From 1ad97828413a60491fba56bdf8eb6fbd4d85b127 Mon Sep 17 00:00:00 2001 From: Eli <88557639+lishaduck@users.noreply.github.com> Date: Sat, 17 Aug 2024 23:36:42 -0500 Subject: [PATCH] refactor: centralize linting configuration --- packages/analysis_options/README.md | 24 ++ .../analysis_options/analysis_options.yaml | 5 + .../lib/analysis_options.dart | 2 + .../lib/analysis_options.yaml | 75 ++++ packages/analysis_options/pubspec.lock | 330 ++++++++++++++++++ packages/analysis_options/pubspec.yaml | 16 + packages/app/analysis_options.yaml | 78 +---- packages/app/pubspec.lock | 9 +- packages/app/pubspec.yaml | 2 +- packages/flutter_checks/analysis_options.yaml | 78 +---- packages/flutter_checks/pubspec.lock | 89 ++++- packages/flutter_checks/pubspec.yaml | 3 +- packages/legacy_checks/analysis_options.yaml | 78 +---- packages/legacy_checks/pubspec.lock | 89 ++++- packages/legacy_checks/pubspec.yaml | 3 +- 15 files changed, 644 insertions(+), 237 deletions(-) create mode 100644 packages/analysis_options/README.md create mode 100644 packages/analysis_options/analysis_options.yaml create mode 100644 packages/analysis_options/lib/analysis_options.dart create mode 100644 packages/analysis_options/lib/analysis_options.yaml create mode 100644 packages/analysis_options/pubspec.lock create mode 100644 packages/analysis_options/pubspec.yaml diff --git a/packages/analysis_options/README.md b/packages/analysis_options/README.md new file mode 100644 index 0000000..f10eb8f --- /dev/null +++ b/packages/analysis_options/README.md @@ -0,0 +1,24 @@ +# `analysis_options` + +Provide a strict lint configuration. + +## Features + +- Strictest selection of lints around! +- Follows [Effective Dart][effective-dart] even more than [VGA]. + +## Getting started + +To use the lints, add as a dev dependency in your `pubspec.yaml`; +then, add an include in `analysis_options.yaml`: + +```yaml +include: package:analysis_options/analysis_options.yaml +``` + +## Additional information + +This is based on [VGA], changes are PRed back. + +[effective-dart]: https://dart.dev/effective-dart +[VGA]: https://pub.dev/packages/very_good_analysis diff --git a/packages/analysis_options/analysis_options.yaml b/packages/analysis_options/analysis_options.yaml new file mode 100644 index 0000000..18b8819 --- /dev/null +++ b/packages/analysis_options/analysis_options.yaml @@ -0,0 +1,5 @@ +include: lib/analysis_options.yaml + +analyzer: + plugins: + - custom_lint diff --git a/packages/analysis_options/lib/analysis_options.dart b/packages/analysis_options/lib/analysis_options.dart new file mode 100644 index 0000000..65c1e53 --- /dev/null +++ b/packages/analysis_options/lib/analysis_options.dart @@ -0,0 +1,2 @@ +/// Analyzer configuration for the Our Democracy team. +library; diff --git a/packages/analysis_options/lib/analysis_options.yaml b/packages/analysis_options/lib/analysis_options.yaml new file mode 100644 index 0000000..6141391 --- /dev/null +++ b/packages/analysis_options/lib/analysis_options.yaml @@ -0,0 +1,75 @@ +# This file configures the analyzer, which statically analyzes Dart code to +# check for errors, warnings, and lints. +# +# The issues identified by the analyzer are surfaced in the UI of Dart-enabled +# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be +# invoked from the command line by running `flutter analyze`. + +# The following line activates a set of recommended lints for Flutter apps, +# packages, and plugins designed to encourage good coding practices. +include: package:very_good_analysis/analysis_options.yaml + +analyzer: + exclude: + - "lib/gen/**" + - "lib/src/l10n/app_localizations*.dart" + - "lib/generated_plugin_registrant.dart" + - "test/.test_coverage.dart" + - "build/**" + - "**/*.g.dart" + - "**/*.gr.dart" + - "**/*.gen.dart" + - "**/*.freezed.dart" + +linter: + # The lint rules applied to this project can be customized in the + # section below to disable rules from the `package:flutter_lints/flutter.yaml` + # included above or to enable additional rules. A list of all available lints + # and their documentation is published at https://dart.dev/lints. + # + # Instead of disabling a lint rule for the entire project in the + # section below, it can also be suppressed for a single line of code + # or a specific dart file by using the `// ignore: name_of_lint` and + # `// ignore_for_file: name_of_lint` syntax on the line or in the file + # producing the lint. + rules: + # Differences from VGA + prefer_relative_imports: true + always_use_package_imports: false + lines_longer_than_80_chars: false + one_member_abstracts: false + + # Extra rules, not in VGA + avoid_classes_with_only_static_members: true + avoid_implementing_value_types: true + avoid_types_on_closure_parameters: true + deprecated_member_use_from_same_package: true + diagnostic_describe_all_properties: true + no_literal_bool_comparisons: true + prefer_foreach: true + prefer_mixin: true + type_literal_in_constant_pattern: true + unnecessary_null_aware_operator_on_extension_on_nullable: true + unreachable_from_main: true + + # Temporary suppression of rules in VGA + public_member_api_docs: false + + # Rules with false-positives, not in VGA + discarded_futures: true + close_sinks: true + + # Experimental rules, not yet in VGA + annotate_redeclares: true + + # New/updated rules, not yet in VGA + unintended_html_in_doc_comment: true + invalid_runtime_check_with_js_interop_types: true + unnecessary_library_name: true + document_ignores: true + avoid_catches_without_on_clauses: true + + # Newly (or soon-to-be) deprecated rules, still in VGA + unnecessary_await_in_return: false +# Additional information about this file can be found at +# https://dart.dev/guides/language/analysis-options diff --git a/packages/analysis_options/pubspec.lock b/packages/analysis_options/pubspec.lock new file mode 100644 index 0000000..674545b --- /dev/null +++ b/packages/analysis_options/pubspec.lock @@ -0,0 +1,330 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + sha256: "45cfa8471b89fb6643fe9bf51bd7931a76b8f5ec2d65de4fb176dba8d4f22c77" + url: "https://pub.dev" + source: hosted + version: "73.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" + analyzer: + dependency: transitive + description: + name: analyzer + sha256: "4959fec185fe70cce007c57e9ab6983101dbe593d2bf8bbfb4453aaec0cf470a" + url: "https://pub.dev" + source: hosted + version: "6.8.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" + args: + dependency: transitive + description: + name: args + sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + url: "https://pub.dev" + source: hosted + version: "2.5.0" + async: + dependency: transitive + description: + name: async + sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" + url: "https://pub.dev" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" + url: "https://pub.dev" + source: hosted + version: "2.1.1" + checked_yaml: + dependency: transitive + description: + name: checked_yaml + sha256: feb6bed21949061731a7a75fc5d2aa727cf160b91af9a3e464c5e3a32e28b5ff + url: "https://pub.dev" + source: hosted + version: "2.0.3" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" + cli_util: + dependency: transitive + description: + name: cli_util + sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + url: "https://pub.dev" + source: hosted + version: "0.4.1" + collection: + dependency: transitive + description: + name: collection + sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf + url: "https://pub.dev" + source: hosted + version: "1.19.0" + convert: + dependency: transitive + description: + name: convert + sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + url: "https://pub.dev" + source: hosted + version: "3.1.1" + crypto: + dependency: transitive + description: + name: crypto + sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + url: "https://pub.dev" + source: hosted + version: "3.0.5" + custom_lint: + dependency: "direct dev" + description: + name: custom_lint + sha256: "4939d89e580c36215e48a7de8fd92f22c79dcc3eb11fda84f3402b3b45aec663" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + url: "https://pub.dev" + source: hosted + version: "2.3.6" + file: + dependency: transitive + description: + name: file + sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" + glob: + dependency: transitive + description: + name: glob + sha256: "0e7014b3b7d4dac1ca4d6114f82bf1782ee86745b9b42a92c9289c23d8a0ab63" + url: "https://pub.dev" + source: hosted + version: "2.1.2" + json_annotation: + dependency: transitive + description: + name: json_annotation + sha256: "1ce844379ca14835a50d2f019a3099f419082cfdd231cd86a142af94dd5c6bb1" + url: "https://pub.dev" + source: hosted + version: "4.9.0" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" + matcher: + dependency: transitive + description: + name: matcher + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb + url: "https://pub.dev" + source: hosted + version: "0.12.16+1" + meta: + dependency: transitive + description: + name: meta + sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 + url: "https://pub.dev" + source: hosted + version: "1.15.0" + package_config: + dependency: transitive + description: + name: package_config + sha256: "1c5b77ccc91e4823a5af61ee74e6b972db1ef98c2ff5a18d3161c982a55448bd" + url: "https://pub.dev" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" + url: "https://pub.dev" + source: hosted + version: "1.9.0" + pub_semver: + dependency: transitive + description: + name: pub_semver + sha256: "40d3ab1bbd474c4c2328c91e3a7df8c6dd629b79ece4c4bd04bee496a224fb0c" + url: "https://pub.dev" + source: hosted + version: "2.1.4" + pubspec_parse: + dependency: transitive + description: + name: pubspec_parse + sha256: c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 + url: "https://pub.dev" + source: hosted + version: "1.3.0" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" + source_span: + dependency: transitive + description: + name: source_span + sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" + url: "https://pub.dev" + source: hosted + version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" + url: "https://pub.dev" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 + url: "https://pub.dev" + source: hosted + version: "2.1.2" + string_scanner: + dependency: transitive + description: + name: string_scanner + sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" + url: "https://pub.dev" + source: hosted + version: "1.3.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 + url: "https://pub.dev" + source: hosted + version: "1.2.1" + test_api: + dependency: transitive + description: + name: test_api + sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" + url: "https://pub.dev" + source: hosted + version: "0.7.3" + typed_data: + dependency: transitive + description: + name: typed_data + sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + url: "https://pub.dev" + source: hosted + version: "1.3.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + url: "https://pub.dev" + source: hosted + version: "4.4.2" + very_good_analysis: + dependency: "direct main" + description: + name: very_good_analysis + sha256: "1fb637c0022034b1f19ea2acb42a3603cbd8314a470646a59a2fb01f5f3a8629" + url: "https://pub.dev" + source: hosted + version: "6.0.0" + watcher: + dependency: transitive + description: + name: watcher + sha256: "3d2ad6751b3c16cf07c7fca317a1413b3f26530319181b37e3b9039b84fc01d8" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + yaml: + dependency: transitive + description: + name: yaml + sha256: "75769501ea3489fca56601ff33454fe45507ea3bfb014161abc3b43ae25989d5" + url: "https://pub.dev" + source: hosted + version: "3.1.2" +sdks: + dart: ">=3.5.0 <4.0.0" diff --git a/packages/analysis_options/pubspec.yaml b/packages/analysis_options/pubspec.yaml new file mode 100644 index 0000000..2fc5f02 --- /dev/null +++ b/packages/analysis_options/pubspec.yaml @@ -0,0 +1,16 @@ +name: analysis_options +description: "Analyzer configuration for the Our Democracy team." +version: 0.0.1 +homepage: https://PHS-TSA.github.io +documentation: https://github.com/PHS-TSA/our_democracy +issue_tracker: https://github.com/PHS-TSA/our_democracy/issues +repository: https://github.com/PHS-TSA/our_democracy.git + +environment: + sdk: ^3.5.0 + +dependencies: + very_good_analysis: ^6.0.0 + +dev_dependencies: + custom_lint: ^0.6.5 diff --git a/packages/app/analysis_options.yaml b/packages/app/analysis_options.yaml index e195be1..d75e702 100644 --- a/packages/app/analysis_options.yaml +++ b/packages/app/analysis_options.yaml @@ -1,81 +1,5 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:very_good_analysis/analysis_options.yaml +include: package:analysis_options/analysis_options.yaml analyzer: - exclude: - - "lib/gen/**" - - "lib/src/l10n/app_localizations*.dart" - - "build/**" - - "**/*.g.dart" - - "**/*.gr.dart" - - "**/*.gen.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - errors: - close_sinks: true plugins: - custom_lint - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # Differences from VGA - prefer_relative_imports: true - always_use_package_imports: false - lines_longer_than_80_chars: false - one_member_abstracts: false - - # Extra rules, not in VGA - avoid_classes_with_only_static_members: true - avoid_implementing_value_types: true - avoid_types_on_closure_parameters: true - deprecated_member_use_from_same_package: true - diagnostic_describe_all_properties: true - no_literal_bool_comparisons: true - prefer_foreach: true - prefer_mixin: true - type_literal_in_constant_pattern: true - unnecessary_null_aware_operator_on_extension_on_nullable: true - unreachable_from_main: true - - # Temporary suppression of rules in VGA - public_member_api_docs: false - - # Rules with false-positives, not in VGA - discarded_futures: true - close_sinks: true - - # Experimental rules, not yet in VGA - annotate_redeclares: true - - # New/updated rules, not yet in VGA - unintended_html_in_doc_comment: true - invalid_runtime_check_with_js_interop_types: true - unnecessary_library_name: true - document_ignores: true - avoid_catches_without_on_clauses: true - - # Newly (or soon-to-be) deprecated rules, still in VGA - unnecessary_await_in_return: false -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/packages/app/pubspec.lock b/packages/app/pubspec.lock index 56c9b50..41784e3 100644 --- a/packages/app/pubspec.lock +++ b/packages/app/pubspec.lock @@ -14,6 +14,13 @@ packages: description: dart source: sdk version: "0.3.2" + analysis_options: + dependency: "direct dev" + description: + path: "../analysis_options" + relative: true + source: path + version: "0.0.1" analyzer: dependency: transitive description: @@ -1438,7 +1445,7 @@ packages: source: hosted version: "2.1.4" very_good_analysis: - dependency: "direct dev" + dependency: transitive description: name: very_good_analysis sha256: "1fb637c0022034b1f19ea2acb42a3603cbd8314a470646a59a2fb01f5f3a8629" diff --git a/packages/app/pubspec.yaml b/packages/app/pubspec.yaml index dfcd66b..5c46f1a 100644 --- a/packages/app/pubspec.yaml +++ b/packages/app/pubspec.yaml @@ -59,6 +59,7 @@ dependencies: shared_preferences: ^2.3.2 dev_dependencies: + analysis_options: any auto_route_generator: ^9.0.0 build_runner: ^2.4.12 build_web_compilers: ^4.0.11 @@ -76,7 +77,6 @@ dev_dependencies: mocktail: ^1.0.4 riverpod_generator: ^2.4.3 riverpod_lint: ^2.3.13 - very_good_analysis: ^6.0.0 very_good_cli: ^0.22.2 # For information on the generic Dart part of this file, see the diff --git a/packages/flutter_checks/analysis_options.yaml b/packages/flutter_checks/analysis_options.yaml index e195be1..d75e702 100644 --- a/packages/flutter_checks/analysis_options.yaml +++ b/packages/flutter_checks/analysis_options.yaml @@ -1,81 +1,5 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:very_good_analysis/analysis_options.yaml +include: package:analysis_options/analysis_options.yaml analyzer: - exclude: - - "lib/gen/**" - - "lib/src/l10n/app_localizations*.dart" - - "build/**" - - "**/*.g.dart" - - "**/*.gr.dart" - - "**/*.gen.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - errors: - close_sinks: true plugins: - custom_lint - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # Differences from VGA - prefer_relative_imports: true - always_use_package_imports: false - lines_longer_than_80_chars: false - one_member_abstracts: false - - # Extra rules, not in VGA - avoid_classes_with_only_static_members: true - avoid_implementing_value_types: true - avoid_types_on_closure_parameters: true - deprecated_member_use_from_same_package: true - diagnostic_describe_all_properties: true - no_literal_bool_comparisons: true - prefer_foreach: true - prefer_mixin: true - type_literal_in_constant_pattern: true - unnecessary_null_aware_operator_on_extension_on_nullable: true - unreachable_from_main: true - - # Temporary suppression of rules in VGA - public_member_api_docs: false - - # Rules with false-positives, not in VGA - discarded_futures: true - close_sinks: true - - # Experimental rules, not yet in VGA - annotate_redeclares: true - - # New/updated rules, not yet in VGA - unintended_html_in_doc_comment: true - invalid_runtime_check_with_js_interop_types: true - unnecessary_library_name: true - document_ignores: true - avoid_catches_without_on_clauses: true - - # Newly (or soon-to-be) deprecated rules, still in VGA - unnecessary_await_in_return: false -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/packages/flutter_checks/pubspec.lock b/packages/flutter_checks/pubspec.lock index 3934221..22fa77c 100644 --- a/packages/flutter_checks/pubspec.lock +++ b/packages/flutter_checks/pubspec.lock @@ -14,6 +14,13 @@ packages: description: dart source: sdk version: "0.3.2" + analysis_options: + dependency: "direct dev" + description: + path: "../analysis_options" + relative: true + source: path + version: "0.0.1" analyzer: dependency: transitive description: @@ -22,6 +29,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.7.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" archive: dependency: transitive description: @@ -78,6 +93,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" cli_completion: dependency: transitive description: @@ -142,6 +165,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + custom_lint: + dependency: "direct dev" + description: + name: custom_lint + sha256: "4939d89e580c36215e48a7de8fd92f22c79dcc3eb11fda84f3402b3b45aec663" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + url: "https://pub.dev" + source: hosted + version: "2.3.6" equatable: dependency: transitive description: @@ -174,6 +221,14 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" flutter: dependency: transitive description: flutter @@ -184,6 +239,14 @@ packages: description: flutter source: sdk version: "0.0.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" frontend_server_client: dependency: transitive description: @@ -471,6 +534,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" safe_url_check: dependency: transitive description: @@ -540,6 +611,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -620,6 +699,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + url: "https://pub.dev" + source: hosted + version: "4.4.2" vector_math: dependency: transitive description: @@ -629,7 +716,7 @@ packages: source: hosted version: "2.1.4" very_good_analysis: - dependency: "direct dev" + dependency: transitive description: name: very_good_analysis sha256: "1fb637c0022034b1f19ea2acb42a3603cbd8314a470646a59a2fb01f5f3a8629" diff --git a/packages/flutter_checks/pubspec.yaml b/packages/flutter_checks/pubspec.yaml index abc7078..52585ef 100644 --- a/packages/flutter_checks/pubspec.yaml +++ b/packages/flutter_checks/pubspec.yaml @@ -17,7 +17,8 @@ dependencies: matcher: ^0.12.16+1 dev_dependencies: - very_good_analysis: ^6.0.0 + analysis_options: any + custom_lint: ^0.6.5 very_good_cli: ^0.22.2 # For information on the generic Dart part of this file, see the diff --git a/packages/legacy_checks/analysis_options.yaml b/packages/legacy_checks/analysis_options.yaml index e195be1..d75e702 100644 --- a/packages/legacy_checks/analysis_options.yaml +++ b/packages/legacy_checks/analysis_options.yaml @@ -1,81 +1,5 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:very_good_analysis/analysis_options.yaml +include: package:analysis_options/analysis_options.yaml analyzer: - exclude: - - "lib/gen/**" - - "lib/src/l10n/app_localizations*.dart" - - "build/**" - - "**/*.g.dart" - - "**/*.gr.dart" - - "**/*.gen.dart" - - "**/*.freezed.dart" - language: - strict-casts: true - strict-inference: true - strict-raw-types: true - errors: - close_sinks: true plugins: - custom_lint - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # Differences from VGA - prefer_relative_imports: true - always_use_package_imports: false - lines_longer_than_80_chars: false - one_member_abstracts: false - - # Extra rules, not in VGA - avoid_classes_with_only_static_members: true - avoid_implementing_value_types: true - avoid_types_on_closure_parameters: true - deprecated_member_use_from_same_package: true - diagnostic_describe_all_properties: true - no_literal_bool_comparisons: true - prefer_foreach: true - prefer_mixin: true - type_literal_in_constant_pattern: true - unnecessary_null_aware_operator_on_extension_on_nullable: true - unreachable_from_main: true - - # Temporary suppression of rules in VGA - public_member_api_docs: false - - # Rules with false-positives, not in VGA - discarded_futures: true - close_sinks: true - - # Experimental rules, not yet in VGA - annotate_redeclares: true - - # New/updated rules, not yet in VGA - unintended_html_in_doc_comment: true - invalid_runtime_check_with_js_interop_types: true - unnecessary_library_name: true - document_ignores: true - avoid_catches_without_on_clauses: true - - # Newly (or soon-to-be) deprecated rules, still in VGA - unnecessary_await_in_return: false -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/packages/legacy_checks/pubspec.lock b/packages/legacy_checks/pubspec.lock index 1f7b649..5de4925 100644 --- a/packages/legacy_checks/pubspec.lock +++ b/packages/legacy_checks/pubspec.lock @@ -14,6 +14,13 @@ packages: description: dart source: sdk version: "0.3.2" + analysis_options: + dependency: "direct dev" + description: + path: "../analysis_options" + relative: true + source: path + version: "0.0.1" analyzer: dependency: transitive description: @@ -22,6 +29,14 @@ packages: url: "https://pub.dev" source: hosted version: "6.8.0" + analyzer_plugin: + dependency: transitive + description: + name: analyzer_plugin + sha256: "9661b30b13a685efaee9f02e5d01ed9f2b423bd889d28a304d02d704aee69161" + url: "https://pub.dev" + source: hosted + version: "0.11.3" archive: dependency: transitive description: @@ -70,6 +85,14 @@ packages: url: "https://pub.dev" source: hosted version: "0.3.0" + ci: + dependency: transitive + description: + name: ci + sha256: "145d095ce05cddac4d797a158bc4cf3b6016d1fe63d8c3d2fbd7212590adca13" + url: "https://pub.dev" + source: hosted + version: "0.1.0" cli_completion: dependency: transitive description: @@ -126,6 +149,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + custom_lint: + dependency: "direct dev" + description: + name: custom_lint + sha256: "4939d89e580c36215e48a7de8fd92f22c79dcc3eb11fda84f3402b3b45aec663" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + custom_lint_core: + dependency: transitive + description: + name: custom_lint_core + sha256: "4ddbbdaa774265de44c97054dcec058a83d9081d071785ece601e348c18c267d" + url: "https://pub.dev" + source: hosted + version: "0.6.5" + dart_style: + dependency: transitive + description: + name: dart_style + sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + url: "https://pub.dev" + source: hosted + version: "2.3.6" equatable: dependency: transitive description: @@ -150,6 +197,22 @@ packages: url: "https://pub.dev" source: hosted version: "7.0.0" + fixnum: + dependency: transitive + description: + name: fixnum + sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + url: "https://pub.dev" + source: hosted + version: "1.1.0" + freezed_annotation: + dependency: transitive + description: + name: freezed_annotation + sha256: c2e2d632dd9b8a2b7751117abcfc2b4888ecfe181bd9fca7170d9ef02e595fe2 + url: "https://pub.dev" + source: hosted + version: "2.4.4" frontend_server_client: dependency: transitive description: @@ -398,6 +461,14 @@ packages: url: "https://pub.dev" source: hosted version: "3.1.2" + rxdart: + dependency: transitive + description: + name: rxdart + sha256: "5c3004a4a8dbb94bd4bf5412a4def4acdaa12e12f269737a5751369e12d1a962" + url: "https://pub.dev" + source: hosted + version: "0.28.0" safe_url_check: dependency: transitive description: @@ -462,6 +533,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.10.0" + sprintf: + dependency: transitive + description: + name: sprintf + sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" + url: "https://pub.dev" + source: hosted + version: "7.0.0" stack_trace: dependency: transitive description: @@ -542,8 +621,16 @@ packages: url: "https://pub.dev" source: hosted version: "2.2.2" + uuid: + dependency: transitive + description: + name: uuid + sha256: "83d37c7ad7aaf9aa8e275490669535c8080377cfa7a7004c24dfac53afffaa90" + url: "https://pub.dev" + source: hosted + version: "4.4.2" very_good_analysis: - dependency: "direct dev" + dependency: transitive description: name: very_good_analysis sha256: "1fb637c0022034b1f19ea2acb42a3603cbd8314a470646a59a2fb01f5f3a8629" diff --git a/packages/legacy_checks/pubspec.yaml b/packages/legacy_checks/pubspec.yaml index ae21303..aafbdef 100644 --- a/packages/legacy_checks/pubspec.yaml +++ b/packages/legacy_checks/pubspec.yaml @@ -14,6 +14,7 @@ dependencies: matcher: ^0.12.16+1 dev_dependencies: - very_good_analysis: ^6.0.0 + analysis_options: any + custom_lint: ^0.6.5 test: ^1.25.8 very_good_cli: ^0.22.2