Skip to content

Commit

Permalink
update dependecies
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Jan 23, 2025
1 parent 10083ca commit 09971b0
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 33 deletions.
5 changes: 3 additions & 2 deletions packages/mix_lint/lib/src/lints/attributes_ordering.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:analyzer/error/error.dart' hide LintCode;
import 'package:analyzer/error/listener.dart';
import 'package:analyzer/source/source_range.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';

import '../utils/type_checker.dart';

const _whiteList = ['Style.asAttribute'];
Expand Down Expand Up @@ -33,7 +34,7 @@ class AttributesOrdering extends DartLintRule {
final arguments = node.argumentList.arguments;

if (_hasAnyAttributeOutOfOrder(arguments)) {
reporter.reportErrorForNode(_code, node);
reporter.atNode(node, _code);
}
});

Expand All @@ -43,7 +44,7 @@ class AttributesOrdering extends DartLintRule {
final arguments = expression.argumentList.arguments;

if (_hasAnyAttributeOutOfOrder(arguments)) {
reporter.reportErrorForNode(_code, expression);
reporter.atNode(expression, _code);
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:analyzer/error/listener.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';

import '../utils/extensions/instance_creation_expression.dart';
import '../utils/type_checker.dart';

Expand Down Expand Up @@ -27,7 +28,7 @@ class AvoidDefiningTokensWithinThemeData extends DartLintRule {

if (!node.isDecendentOf(mixThemeDataChecker)) return;

reporter.reportErrorForOffset(_code, node.offset, node.length);
reporter.atNode(node, _code);
});
}
}
6 changes: 1 addition & 5 deletions packages/mix_lint/lib/src/lints/avoid_empty_variants.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ class AvoidEmptyVariants extends DartLintRule {
if (!variantAttributeChecker.isAssignableFromType(type)) return;

if (expression.argumentList.arguments.isEmpty) {
reporter.reportErrorForOffset(
_code,
expression.offset,
expression.length,
);
reporter.atNode(expression, _code);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/error/error.dart' hide LintCode;
import 'package:analyzer/error/listener.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';

import '../utils/type_checker.dart';
import '../utils/visitors.dart';

Expand Down Expand Up @@ -48,7 +49,7 @@ class AvoidVariantInsideContextVariant extends DartLintRule {
if (types.isEmpty) return;

for (final type in types) {
reporter.reportErrorForOffset(_code, type.offset, type.length);
reporter.atNode(type, _code);
}
});
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';
import 'max_number_of_attributes_per_style_parameters.dart';
import '../../utils/extensions/lint_rule_node_registry.dart';
import '../../utils/type_checker.dart';

import '../../utils/extensions/lint_rule_node_registry.dart';
import '../../utils/rule_config.dart';
import '../../utils/type_checker.dart';
import 'max_number_of_attributes_per_style_parameters.dart';

class MaxNumberOfAttributesPerStyle extends DartLintRule {
final MaxNumberOfAttributesPerStyleParameters parameters;
Expand Down Expand Up @@ -38,7 +38,7 @@ class MaxNumberOfAttributesPerStyle extends DartLintRule {
styleChecker,
(node) {
if (node.argumentList.arguments.length > parameters.maxNumber) {
reporter.reportErrorForNode(code, node);
reporter.atNode(node, code);
}
},
);
Expand All @@ -47,7 +47,7 @@ class MaxNumberOfAttributesPerStyle extends DartLintRule {
variantAttributeChecker,
(node) {
if (node.argumentList.arguments.length > parameters.maxNumber) {
reporter.reportErrorForNode(code, node);
reporter.atNode(node, code);
}
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/error/error.dart';
import 'package:analyzer/error/listener.dart';
import 'package:custom_lint_builder/custom_lint_builder.dart';

import 'instance_creation_expression.dart';

extension LintRuleNodeRegistryExt on LintRuleNodeRegistry {
Expand All @@ -12,7 +13,9 @@ extension LintRuleNodeRegistryExt on LintRuleNodeRegistry {
addInstanceCreationExpression((node) {
final type = node.staticType;
if (type == null || //
!checker.isAssignableFromType(type)) return;
!checker.isAssignableFromType(type)) {
return;
}

listener(node);
});
Expand All @@ -25,7 +28,9 @@ extension LintRuleNodeRegistryExt on LintRuleNodeRegistry {
addFunctionExpressionInvocation((node) {
final type = node.staticType;
if (type == null || //
!checker.isAssignableFromType(type)) return;
!checker.isAssignableFromType(type)) {
return;
}

listener(node);
});
Expand All @@ -42,7 +47,7 @@ extension CustomLintContextExt on CustomLintContext {
registry.addInstanceCreationExpressionFor(child, (node) {
if (!node.isDecendentOf(parent)) return;

reporter.reportErrorForOffset(code, node.offset, node.length);
reporter.atNode(node, code);
});
}
}
6 changes: 3 additions & 3 deletions packages/mix_lint/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ environment:
sdk: ">=3.3.0 <4.0.0"

dependencies:
analyzer: ^6.0.0
analyzer_plugin: ^0.11.2
custom_lint_builder: ^0.6.0
analyzer: ^7.0.0
analyzer_plugin: ^0.12.0
custom_lint_builder: ^0.7.1

dev_dependencies:
test: ^1.24.0
Expand Down
12 changes: 5 additions & 7 deletions packages/mix_lint_test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,15 @@ environment:
dependencies:
flutter:
sdk: flutter
mix:
mix:
path: ../mix
mix_lint:
path: ../mix_lint


dev_dependencies:
flutter_test:
sdk: flutter
custom_lint: ^0.6.4
analyzer: ^6.0.0
analyzer_plugin: ^0.11.2
test: ^1.24.9

custom_lint: ^0.7.1
# analyzer: ^6.0.0
# analyzer_plugin: ^0.11.2
# test: ^1.24.9
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,19 @@ final inOrder_1 = Style(
$icon.color.amber(),
$text.capitalize(),
$stack.fit.expand(),
$on.dark(),
$on.dark(
$box.height(20),
),
$with.clipOval(),
_style(),
test(),
);

final inOrder_2 = Style(
$flex.column(),
$on.dark(),
$text.capitalize(),
$on.dark(
$text.capitalize(),
),
$with.clipOval(),
_style(),
$box.height(20),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'package:test/test.dart';

void main() {
test('Test for attributes_ordering', () async {
expect(true, true);
Expand Down
2 changes: 1 addition & 1 deletion packages/mix_lint_test/test/utils/golden.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ import 'package:analyzer/dart/analysis/results.dart';
import 'package:analyzer/dart/analysis/utilities.dart';
import 'package:analyzer_plugin/protocol/protocol_generated.dart';
import 'package:custom_lint_core/custom_lint_core.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:path/path.dart';
import 'package:test/test.dart';

@Deprecated('Do not commit')
bool goldenWrite = false;
Expand Down

0 comments on commit 09971b0

Please sign in to comment.