From ba640dac50cff3526274e2bc8130bc80346485c7 Mon Sep 17 00:00:00 2001 From: Istvan Soos Date: Wed, 18 Oct 2023 18:37:11 +0200 Subject: [PATCH] Upgrade lints to 3.0.0 --- CHANGELOG.md | 4 ++++ lib/src/tag/_violations.dart | 2 ++ lib/src/tag/tagger.dart | 1 + lib/src/version.dart | 2 +- pubspec.yaml | 4 ++-- test/goldens/end2end/dnd-2.0.1.json | 2 +- test/goldens/end2end/dnd-2.0.1.json_report.md | 14 ++++++------- test/goldens/end2end/http-0.13.0.json | 8 ++++---- .../end2end/http-0.13.0.json_report.md | 20 +++++++++++++++++-- test/goldens/end2end/steward-0.3.1.json | 2 +- .../end2end/steward-0.3.1.json_report.md | 2 +- test/package_server.dart | 4 ++-- 12 files changed, 44 insertions(+), 21 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e1792f64..da8ccb427 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.21.40 + +- Upgraded `package:lints` to `3.0.0`. + ## 0.21.39 - Removed file size checks. (If upload limits allow it, `pana` should not complain.) diff --git a/lib/src/tag/_violations.dart b/lib/src/tag/_violations.dart index 3b1916f47..4381c87a7 100644 --- a/lib/src/tag/_violations.dart +++ b/lib/src/tag/_violations.dart @@ -81,6 +81,8 @@ /// If both "platforms" and "flutter.platforms" are declared "platforms" takes /// precedence. (There might be rare cases where you want to declare a more /// narrow set of platforms than you have plugin support for). +library _violations; + import 'package:analyzer/dart/analysis/session.dart'; import '../sdk_env.dart' show ToolException; diff --git a/lib/src/tag/tagger.dart b/lib/src/tag/tagger.dart index 4437c2c71..7af92e346 100644 --- a/lib/src/tag/tagger.dart +++ b/lib/src/tag/tagger.dart @@ -70,6 +70,7 @@ /// * platform:windows /// /// A package has the same platform tags as the primary library. +library tagger; import 'dart:io'; diff --git a/lib/src/version.dart b/lib/src/version.dart index 5e3440197..6971d1bce 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -1,2 +1,2 @@ // Generated code. Do not modify. -const packageVersion = '0.21.39'; +const packageVersion = '0.21.40-dev'; diff --git a/pubspec.yaml b/pubspec.yaml index 5516e29c2..3c1cafe52 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: pana description: PAckage aNAlyzer - produce a report summarizing the health and quality of a Dart package. -version: 0.21.39 +version: 0.21.40-dev repository: https://github.com/dart-lang/pana topics: - tool @@ -19,7 +19,7 @@ dependencies: http: ^1.0.0 io: ^1.0.0 json_annotation: ^4.8.1 - lints: ^2.0.0 + lints: ^3.0.0 logging: ^1.0.0 markdown: ^7.0.0 path: ^1.6.2 diff --git a/test/goldens/end2end/dnd-2.0.1.json b/test/goldens/end2end/dnd-2.0.1.json index d54190b59..efa15d4ab 100644 --- a/test/goldens/end2end/dnd-2.0.1.json +++ b/test/goldens/end2end/dnd-2.0.1.json @@ -79,7 +79,7 @@ "grantedPoints": 30, "maxPoints": 50, "status": "failed", - "summary": "### [x] 30/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 3 issues. Showing the first 2:\n\n
\n\nWARNING: Unnecessary type check; the result is always 'true'.\n\n\n`lib/src/draggable_manager.dart:183:9`\n\n```\n ╷\n183 │ if (target is Element &&\r\n │ ^^^^^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/draggable_manager.dart`\n
\n
\n\nINFO: Missing a deprecation message.\n\n\n`lib/src/draggable.dart:62:3`\n\n```\n ╷\n62 │ @deprecated\r\n │ ^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/draggable.dart`\n
" + "summary": "### [x] 30/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 9 issues. Showing the first 2:\n\n
\n\nWARNING: Unnecessary type check; the result is always 'true'.\n\n\n`lib/src/draggable_manager.dart:183:9`\n\n```\n ╷\n183 │ if (target is Element &&\r\n │ ^^^^^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/draggable_manager.dart`\n
\n
\n\nINFO: The part-of directive uses a library name.\n\n\n`lib/src/draggable.dart:1:1`\n\n```\n ╷\n1 │ part of dnd;\r\n │ ^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/draggable.dart`\n
" }, { "id": "dependency", diff --git a/test/goldens/end2end/dnd-2.0.1.json_report.md b/test/goldens/end2end/dnd-2.0.1.json_report.md index 72edc793e..ea6e0a69b 100644 --- a/test/goldens/end2end/dnd-2.0.1.json_report.md +++ b/test/goldens/end2end/dnd-2.0.1.json_report.md @@ -76,7 +76,7 @@ Because: ### [x] 30/50 points: code has no errors, warnings, lints, or formatting issues -Found 3 issues. Showing the first 2: +Found 9 issues. Showing the first 2:
@@ -96,16 +96,16 @@ To reproduce make sure you are using the [lints_core](https://pub.dev/packages/l
-INFO: Missing a deprecation message. +INFO: The part-of directive uses a library name. -`lib/src/draggable.dart:62:3` +`lib/src/draggable.dart:1:1` ``` - ╷ -62 │ @deprecated - │ ^^^^^^^^^^^ - ╵ + ╷ +1 │ part of dnd; + │ ^^^^^^^^^^^^ + ╵ ``` To reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/src/draggable.dart` diff --git a/test/goldens/end2end/http-0.13.0.json b/test/goldens/end2end/http-0.13.0.json index 3753c3ef0..1f127c63c 100644 --- a/test/goldens/end2end/http-0.13.0.json +++ b/test/goldens/end2end/http-0.13.0.json @@ -96,10 +96,10 @@ { "id": "analysis", "title": "Pass static analysis", - "grantedPoints": 50, + "grantedPoints": 40, "maxPoints": 50, - "status": "passed", - "summary": "### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues\n" + "status": "partial", + "summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\n
\n\nINFO: Dangling library doc comment.\n\n\n`lib/http.dart:5:1`\n\n```\n ╷\n5 │ /// A composable, [Future]-based library for making HTTP requests.\n │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/http.dart`\n
" }, { "id": "dependency", @@ -122,7 +122,7 @@ "branch": "master", "path": "pkgs/http" }, - "grantedPoints": 130, + "grantedPoints": 120, "maxPoints": 130 }, "urlProblems": [] diff --git a/test/goldens/end2end/http-0.13.0.json_report.md b/test/goldens/end2end/http-0.13.0.json_report.md index a8e14856a..292d4b688 100644 --- a/test/goldens/end2end/http-0.13.0.json_report.md +++ b/test/goldens/end2end/http-0.13.0.json_report.md @@ -29,10 +29,26 @@ Detected license: `BSD-3-Clause`. * ✓ MacOS * ✓ Web -## 50/50 Pass static analysis +## 40/50 Pass static analysis -### [*] 50/50 points: code has no errors, warnings, lints, or formatting issues +### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues +
+ +INFO: Dangling library doc comment. + + +`lib/http.dart:5:1` + +``` + ╷ +5 │ /// A composable, [Future]-based library for making HTTP requests. + │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + ╵ +``` + +To reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/http.dart` +
## 20/20 Support up-to-date dependencies diff --git a/test/goldens/end2end/steward-0.3.1.json b/test/goldens/end2end/steward-0.3.1.json index 3db418174..b8a6a564f 100644 --- a/test/goldens/end2end/steward-0.3.1.json +++ b/test/goldens/end2end/steward-0.3.1.json @@ -103,7 +103,7 @@ "grantedPoints": 40, "maxPoints": 50, "status": "partial", - "summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 24 issues. Showing the first 2:\n\n
\n\nINFO: The variable name 'GetAnnotation' isn't a lowerCamelCase identifier.\n\n\n`lib/controllers/route_utils.dart:79:7`\n\n```\n ╷\n79 │ final GetAnnotation = reflectClass(Get);\n │ ^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/controllers/route_utils.dart`\n
\n
\n\nINFO: The variable name 'PutAnnotation' isn't a lowerCamelCase identifier.\n\n\n`lib/controllers/route_utils.dart:82:7`\n\n```\n ╷\n82 │ final PutAnnotation = reflectClass(Put);\n │ ^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/controllers/route_utils.dart`\n
" + "summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 25 issues. Showing the first 2:\n\n
\n\nINFO: The variable name 'GetAnnotation' isn't a lowerCamelCase identifier.\n\n\n`lib/controllers/route_utils.dart:79:7`\n\n```\n ╷\n79 │ final GetAnnotation = reflectClass(Get);\n │ ^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/controllers/route_utils.dart`\n
\n
\n\nINFO: The variable name 'PutAnnotation' isn't a lowerCamelCase identifier.\n\n\n`lib/controllers/route_utils.dart:82:7`\n\n```\n ╷\n82 │ final PutAnnotation = reflectClass(Put);\n │ ^^^^^^^^^^^^^\n ╵\n```\n\nTo reproduce make sure you are using the [lints_core](https://pub.dev/packages/lints) and run `dart analyze lib/controllers/route_utils.dart`\n
" }, { "id": "dependency", diff --git a/test/goldens/end2end/steward-0.3.1.json_report.md b/test/goldens/end2end/steward-0.3.1.json_report.md index 2185b13af..e6e1738ab 100644 --- a/test/goldens/end2end/steward-0.3.1.json_report.md +++ b/test/goldens/end2end/steward-0.3.1.json_report.md @@ -68,7 +68,7 @@ Because: ### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues -Found 24 issues. Showing the first 2: +Found 25 issues. Showing the first 2:
diff --git a/test/package_server.dart b/test/package_server.dart index 9eb76212d..73609ecad 100644 --- a/test/package_server.dart +++ b/test/package_server.dart @@ -262,9 +262,9 @@ class _ServedPackageVersion { class TarFileDescriptor extends d.FileDescriptor { final List contents; - TarFileDescriptor(String name, Iterable contents) + TarFileDescriptor(super.name, Iterable contents) : contents = contents.toList(), - super.protected(name); + super.protected(); Future> allFiles(d.Descriptor descriptor, [String path = '.']) async {