Skip to content
This repository was archived by the owner on Jul 16, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
## Unreleased

* **Breaking Change:** cli arguments `--fatal-unused` and `--fatal-warnings` activate by default.
* chore: restrict `analyzer` version to `>=2.8.0 <3.3.0`.
* chore: restrict `analyzer` version to `>=3.3.0 <3.4.0`.
* chore: restrict `analyzer_plugin` version to `>=0.9.0 <0.10.0`.
* feat: add static code diagnostic `avoid-collection-methods-with-unrelated-types`

## 4.11.0
Expand Down
3 changes: 2 additions & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ dart_code_metrics:
exceptions:
- id
- ok
- prefer-correct-type-name
- prefer-correct-type-name:
max-length: 44
- prefer-first
- prefer-last
- prefer-match-file-name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class AvoidCollectionMethodsWithUnrelatedTypesRule extends CommonRule {

static const _warning = 'Avoid collection methods with unrelated types.';

AvoidCollectionMethodsWithUnrelatedTypesRule(
[Map<String, Object> config = const {}])
: super(
AvoidCollectionMethodsWithUnrelatedTypesRule([
Map<String, Object> config = const {},
]) : super(
id: ruleId,
severity: readSeverity(config, Severity.warning),
excludes: readExcludes(config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class _Visitor extends RecursiveAstVisitor<void> {

@override
void visitClassDeclaration(ClassDeclaration node) {
final classType = node.extendsClause?.superclass2.type;
final classType = node.extendsClause?.superclass.type;
if (!isWidgetOrSubclass(classType) && !isWidgetStateOrSubclass(classType)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class _Visitor extends RecursiveAstVisitor<void> {
void visitClassDeclaration(ClassDeclaration node) {
super.visitClassDeclaration(node);

final type = node.extendsClause?.superclass2.type;
final type = node.extendsClause?.superclass.type;
if (type == null || !isWidgetStateOrSubclass(type)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class _Visitor extends SimpleAstVisitor<void> {

@override
void visitClassDeclaration(ClassDeclaration node) {
final classType = node.extendsClause?.superclass2.type;
final classType = node.extendsClause?.superclass.type;
if (!isWidgetOrSubclass(classType) && !isWidgetStateOrSubclass(classType)) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class _Visitor extends SimpleAstVisitor<void> {
void visitClassDeclaration(ClassDeclaration node) {
super.visitClassDeclaration(node);

final classType = node.extendsClause?.superclass2.type;
final classType = node.extendsClause?.superclass.type;
if (isWidgetOrSubclass(classType) &&
(!_ignorePrivateWidgets || !Identifier.isPrivateName(node.name.name))) {
_nodes.add(node);
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ environment:
sdk: ">=2.14.0 <3.0.0"

dependencies:
analyzer: ">=2.8.0 <3.3.0"
analyzer_plugin: ">=0.8.0 <0.10.0"
analyzer: ">=3.3.0 <3.4.0"
analyzer_plugin: ">=0.9.0 <0.10.0"
ansicolor: ^2.0.1
args: ^2.0.0
collection: ^1.15.0
Expand Down
4 changes: 2 additions & 2 deletions website/docs/cli/check-unused-files.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ The reporter prints a single JSON object containing meta information and the unu

- `formatVersion` - an integer representing the format version (will be incremented each time the serialization format changes)
- `timestamp` - a creation time of the report in YYYY-MM-DD HH:MM:SS format
- `unusedFiles` - an array of [unused files](#the-unusedFiles-object-fields-are)
- `unusedFiles` - an array of [unused files](#the-unused-files-object-fields-are)
- `automaticallyDeleted` - an indication of unused files being automatically deleted

```JSON
Expand All @@ -76,7 +76,7 @@ The reporter prints a single JSON object containing meta information and the unu
}
```

#### The **unusedFiles** object fields are {#the-unusedfiles-object-fields-are}
#### The **unusedFiles** object fields are {#the-unused-files-object-fields-are}

- `path` - a relative path of the unused file

Expand Down