Skip to content

Commit

Permalink
Upgrade lints to 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
isoos committed Oct 18, 2023
1 parent ed4f9de commit ba640da
Show file tree
Hide file tree
Showing 12 changed files with 44 additions and 21 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.)
Expand Down
2 changes: 2 additions & 0 deletions lib/src/tag/_violations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions lib/src/tag/tagger.dart
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
/// * platform:windows
///
/// A package has the same platform tags as the primary library.
library tagger;

import 'dart:io';

Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/dnd-2.0.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<details>\n<summary>\nWARNING: Unnecessary type check; the result is always 'true'.\n</summary>\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</details>\n<details>\n<summary>\nINFO: Missing a deprecation message.\n</summary>\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</details>"
"summary": "### [x] 30/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 9 issues. Showing the first 2:\n\n<details>\n<summary>\nWARNING: Unnecessary type check; the result is always 'true'.\n</summary>\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</details>\n<details>\n<summary>\nINFO: The part-of directive uses a library name.\n</summary>\n\n`lib/src/draggable.dart:1:1`\n\n```\n \n1part 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</details>"
},
{
"id": "dependency",
Expand Down
14 changes: 7 additions & 7 deletions test/goldens/end2end/dnd-2.0.1.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<details>
<summary>
Expand All @@ -96,16 +96,16 @@ To reproduce make sure you are using the [lints_core](https://pub.dev/packages/l
</details>
<details>
<summary>
INFO: Missing a deprecation message.
INFO: The part-of directive uses a library name.
</summary>

`lib/src/draggable.dart:62:3`
`lib/src/draggable.dart:1:1`

```
62 @deprecated
^^^^^^^^^^^
1part 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`
Expand Down
8 changes: 4 additions & 4 deletions test/goldens/end2end/http-0.13.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<details>\n<summary>\nINFO: Dangling library doc comment.\n</summary>\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</details>"
},
{
"id": "dependency",
Expand All @@ -122,7 +122,7 @@
"branch": "master",
"path": "pkgs/http"
},
"grantedPoints": 130,
"grantedPoints": 120,
"maxPoints": 130
},
"urlProblems": []
Expand Down
20 changes: 18 additions & 2 deletions test/goldens/end2end/http-0.13.0.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<details>
<summary>
INFO: Dangling library doc comment.
</summary>

`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`
</details>

## 20/20 Support up-to-date dependencies

Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/steward-0.3.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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<details>\n<summary>\nINFO: The variable name 'GetAnnotation' isn't a lowerCamelCase identifier.\n</summary>\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</details>\n<details>\n<summary>\nINFO: The variable name 'PutAnnotation' isn't a lowerCamelCase identifier.\n</summary>\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</details>"
"summary": "### [~] 40/50 points: code has no errors, warnings, lints, or formatting issues\n\nFound 25 issues. Showing the first 2:\n\n<details>\n<summary>\nINFO: The variable name 'GetAnnotation' isn't a lowerCamelCase identifier.\n</summary>\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</details>\n<details>\n<summary>\nINFO: The variable name 'PutAnnotation' isn't a lowerCamelCase identifier.\n</summary>\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</details>"
},
{
"id": "dependency",
Expand Down
2 changes: 1 addition & 1 deletion test/goldens/end2end/steward-0.3.1.json_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

<details>
<summary>
Expand Down
4 changes: 2 additions & 2 deletions test/package_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ class _ServedPackageVersion {
class TarFileDescriptor extends d.FileDescriptor {
final List<d.Descriptor> contents;

TarFileDescriptor(String name, Iterable<d.Descriptor> contents)
TarFileDescriptor(super.name, Iterable<d.Descriptor> contents)
: contents = contents.toList(),
super.protected(name);
super.protected();

Future<Iterable<TarEntry>> allFiles(d.Descriptor descriptor,
[String path = '.']) async {
Expand Down

0 comments on commit ba640da

Please sign in to comment.