Skip to content

Commit

Permalink
Version 3.6.0-211.0.dev
Browse files Browse the repository at this point in the history
Merge 94eef72 into dev
  • Loading branch information
Dart CI committed Sep 3, 2024
2 parents 0340942 + 94eef72 commit 4d6ffb4
Show file tree
Hide file tree
Showing 261 changed files with 1,355 additions and 1,120 deletions.
1 change: 0 additions & 1 deletion pkg/analysis_server/test/lsp/code_actions_fixes_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class DeprecatedCamelCaseTypes extends LintRule {
DeprecatedCamelCaseTypes()
: super(
name: 'camel_case_types',
categories: {LintRuleCategory.style},
state: State.deprecated(),
description: '',
details: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ class InternalRule extends LintRule {
InternalRule()
: super(
name: 'internal_lint',
categories: {LintRuleCategory.style},
state: State.internal(),
description: '',
details: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class DeprecatedRule extends LintRule {
name: 'deprecated_rule',
description: '',
details: '...',
categories: {LintRuleCategory.errors},
state: State.deprecated(since: dart2_12),
);

Expand All @@ -42,7 +41,6 @@ class RemovedRule extends LintRule {
name: 'removed_rule',
description: '',
details: '...',
categories: {LintRuleCategory.errors},
state: State.removed());

@override
Expand Down
17 changes: 1 addition & 16 deletions pkg/analyzer/lib/src/lint/linter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ abstract class LintRule {

LintRule({
required this.name,
required this.categories,
this.categories = const <String>{},
required this.description,
required this.details,
State? state,
Expand Down Expand Up @@ -327,24 +327,9 @@ abstract class LintRule {
}

abstract final class LintRuleCategory {
/// A category of rules that help to minimize binary size.
static const String binarySize = 'binary size';

/// A category of rules that encourage brevity in the source code.
static const String brevity = 'brevity';

/// A category of rules that help to maintain documentation comments.
static const String documentationCommentMaintenance =
'documentation comment maintenance';

/// A category of rules that align with the Effective Dart style guide.
static const String effectiveDart = 'effective dart';

/// A category representing possible coding errors.
// TODO(srawlins): Hopefully deprecate this (or just rename `error_prone`
// back to this one).
static const String errors = 'errors';

/// A category of rules that protect against error-prone code.
static const String errorProne = 'error-prone';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class RemovedLint extends LintRule {
RemovedLint()
: super(
name: 'removed_lint',
categories: {LintRuleCategory.style},
state: State.removed(since: dart3),
description: '',
details: '',
Expand Down
2 changes: 0 additions & 2 deletions pkg/analyzer/test/src/diagnostics/replaced_lint_use_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class RemovedLint extends LintRule {
RemovedLint()
: super(
name: 'removed_lint',
categories: {LintRuleCategory.style},
state: State.removed(since: dart3, replacedBy: 'replacing_lint'),
description: '',
details: '',
Expand Down Expand Up @@ -65,7 +64,6 @@ class ReplacingLint extends LintRule {
ReplacingLint()
: super(
name: 'replacing_lint',
categories: {LintRuleCategory.style},
state: State.removed(since: dart3),
description: '',
details: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class _AvoidIntRule extends LintRule {
name: 'avoid_int',
description: '',
details: '',
categories: {LintRuleCategory.errors},
);

@override
Expand Down
1 change: 0 additions & 1 deletion pkg/analyzer/test/src/lint/lint_rule_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ class TestRule extends LintRule {
name: 'test_rule',
description: '',
details: '... tl;dr ...',
categories: {LintRuleCategory.errors},
);

@override
Expand Down
2 changes: 0 additions & 2 deletions pkg/analyzer/test/src/options/apply_options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,15 +439,13 @@ class TestRule extends LintRule {
name: 'fantastic_test_rule',
description: '',
details: '',
categories: {LintRuleCategory.style},
);

TestRule.withName(String name)
: super(
name: name,
description: '',
details: '',
categories: {LintRuleCategory.style},
);

@override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ class DeprecatedLint extends LintRule {
DeprecatedLint()
: super(
name: 'deprecated_lint',
categories: {LintRuleCategory.style},
state: State.deprecated(),
description: '',
details: '',
Expand All @@ -38,7 +37,6 @@ class DeprecatedLintWithReplacement extends LintRule {
DeprecatedLintWithReplacement()
: super(
name: 'deprecated_lint_with_replacement',
categories: {LintRuleCategory.style},
state: State.deprecated(replacedBy: 'replacing_lint'),
description: '',
details: '',
Expand All @@ -49,7 +47,6 @@ class DeprecatedSince3Lint extends LintRule {
DeprecatedSince3Lint()
: super(
name: 'deprecated_since_3_lint',
categories: {LintRuleCategory.style},
state: State.deprecated(since: dart3),
description: '',
details: '',
Expand Down Expand Up @@ -293,7 +290,6 @@ class RemovedIn2_12Lint extends LintRule {
RemovedIn2_12Lint()
: super(
name: 'removed_in_2_12_lint',
categories: {LintRuleCategory.style},
state: State.removed(since: dart2_12),
description: '',
details: '',
Expand All @@ -304,7 +300,6 @@ class ReplacedLint extends LintRule {
ReplacedLint()
: super(
name: 'replaced_lint',
categories: {LintRuleCategory.style},
state: State.removed(since: dart3, replacedBy: 'replacing_lint'),
description: '',
details: '',
Expand All @@ -315,7 +310,6 @@ class ReplacingLint extends LintRule {
ReplacingLint()
: super(
name: 'replacing_lint',
categories: {LintRuleCategory.style},
description: '',
details: '',
);
Expand All @@ -325,7 +319,6 @@ class RuleNeg extends LintRule {
RuleNeg()
: super(
name: 'rule_neg',
categories: {LintRuleCategory.style},
description: '',
details: '',
);
Expand All @@ -338,7 +331,6 @@ class RulePos extends LintRule {
RulePos()
: super(
name: 'rule_pos',
categories: {LintRuleCategory.style},
description: '',
details: '',
);
Expand All @@ -351,7 +343,6 @@ class StableLint extends LintRule {
StableLint()
: super(
name: 'stable_lint',
categories: {LintRuleCategory.style},
state: State.stable(),
description: '',
details: '',
Expand Down
2 changes: 0 additions & 2 deletions pkg/analyzer/test/src/task/options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -579,15 +579,13 @@ class TestRule extends LintRule {
name: 'fantastic_test_rule',
description: '',
details: '',
categories: {LintRuleCategory.style},
);

TestRule.withName(String name)
: super(
name: name,
description: '',
details: '',
categories: {LintRuleCategory.style},
);

@override
Expand Down
68 changes: 33 additions & 35 deletions pkg/linter/lib/src/linter_lint_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -520,13 +520,6 @@ class LinterLintCode extends LintCode {
uniqueName: 'deprecated_consistency_constructor',
);

static const LintCode deprecated_consistency_parameter = LinterLintCode(
'deprecated_consistency',
"Parameters that initialize a deprecated field should be deprecated.",
correctionMessage: "Try marking the parameter as deprecated.",
uniqueName: 'deprecated_consistency_parameter',
);

static const LintCode deprecated_consistency_field = LinterLintCode(
'deprecated_consistency',
"Fields that are initialized by a deprecated parameter should be "
Expand All @@ -535,6 +528,13 @@ class LinterLintCode extends LintCode {
uniqueName: 'deprecated_consistency_field',
);

static const LintCode deprecated_consistency_parameter = LinterLintCode(
'deprecated_consistency',
"Parameters that initialize a deprecated field should be deprecated.",
correctionMessage: "Try marking the parameter as deprecated.",
uniqueName: 'deprecated_consistency_parameter',
);

static const LintCode deprecated_member_use_from_same_package_with_message =
LinterLintCode(
'deprecated_member_use_from_same_package',
Expand Down Expand Up @@ -1225,14 +1225,6 @@ class LinterLintCode extends LintCode {
hasPublishedDocs: true,
);

static const LintCode prefer_inlined_adds_single = LinterLintCode(
'prefer_inlined_adds',
"The addition of a list item could be inlined.",
correctionMessage: "Try adding the item to the list literal directly.",
hasPublishedDocs: true,
uniqueName: 'prefer_inlined_adds_single',
);

static const LintCode prefer_inlined_adds_multiple = LinterLintCode(
'prefer_inlined_adds',
"The addition of multiple list items could be inlined.",
Expand All @@ -1241,6 +1233,14 @@ class LinterLintCode extends LintCode {
uniqueName: 'prefer_inlined_adds_multiple',
);

static const LintCode prefer_inlined_adds_single = LinterLintCode(
'prefer_inlined_adds',
"The addition of a list item could be inlined.",
correctionMessage: "Try adding the item to the list literal directly.",
hasPublishedDocs: true,
uniqueName: 'prefer_inlined_adds_single',
);

static const LintCode prefer_int_literals = LinterLintCode(
'prefer_int_literals',
"Unnecessary use of a 'double' literal.",
Expand Down Expand Up @@ -1738,18 +1738,18 @@ class LinterLintCode extends LintCode {
uniqueName: 'unsafe_html_attribute',
);

static const LintCode unsafe_html_method = LinterLintCode(
static const LintCode unsafe_html_constructor = LinterLintCode(
'unsafe_html',
"Invoking the method '{0}' is unsafe.",
"Invoking the constructor '{0}' is unsafe.",
correctionMessage: "Try finding a different way to implement the page.",
uniqueName: 'unsafe_html_method',
uniqueName: 'unsafe_html_constructor',
);

static const LintCode unsafe_html_constructor = LinterLintCode(
static const LintCode unsafe_html_method = LinterLintCode(
'unsafe_html',
"Invoking the constructor '{0}' is unsafe.",
"Invoking the method '{0}' is unsafe.",
correctionMessage: "Try finding a different way to implement the page.",
uniqueName: 'unsafe_html_constructor',
uniqueName: 'unsafe_html_method',
);

static const LintCode use_build_context_synchronously_async_use =
Expand All @@ -1763,18 +1763,6 @@ class LinterLintCode extends LintCode {
uniqueName: 'use_build_context_synchronously_async_use',
);

static const LintCode use_colored_box = LinterLintCode(
'use_colored_box',
"Use a 'ColoredBox' rather than a 'Container' with only a 'Color'.",
correctionMessage: "Try replacing the 'Container' with a 'ColoredBox'.",
);

static const LintCode use_decorated_box = LinterLintCode(
'use_decorated_box',
"Use 'DecoratedBox' rather than a 'Container' with only a 'Decoration'.",
correctionMessage: "Try replacing the 'Container' with a 'DecoratedBox'.",
);

static const LintCode use_build_context_synchronously_wrong_mounted =
LinterLintCode(
'use_build_context_synchronously',
Expand All @@ -1787,6 +1775,18 @@ class LinterLintCode extends LintCode {
uniqueName: 'use_build_context_synchronously_wrong_mounted',
);

static const LintCode use_colored_box = LinterLintCode(
'use_colored_box',
"Use a 'ColoredBox' rather than a 'Container' with only a 'Color'.",
correctionMessage: "Try replacing the 'Container' with a 'ColoredBox'.",
);

static const LintCode use_decorated_box = LinterLintCode(
'use_decorated_box',
"Use 'DecoratedBox' rather than a 'Container' with only a 'Decoration'.",
correctionMessage: "Try replacing the 'Container' with a 'DecoratedBox'.",
);

static const LintCode use_enums = LinterLintCode(
'use_enums',
"Class should be an enum.",
Expand All @@ -1797,8 +1797,6 @@ class LinterLintCode extends LintCode {
'use_full_hex_values_for_flutter_colors',
"Instances of 'Color' should be created using an 8-digit hexadecimal "
"integer (such as '0xFFFFFFFF').",
correctionMessage:
"Try using an 8-digit hexadecimal integer to create the 'Color'.",
hasPublishedDocs: true,
);

Expand Down
2 changes: 1 addition & 1 deletion pkg/linter/lib/src/rules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ void registerLintRules() {
..register(InvalidCasePatterns())
..register(InvariantBooleans())
..register(IterableContainsUnrelatedType())
..register(JoinReturnWithAssignment())
..register(InvalidRuntimeCheckWithJSInteropTypes())
..register(JoinReturnWithAssignment())
..register(LeadingNewlinesInMultilineStrings())
..register(LibraryAnnotations())
..register(LibraryNames())
Expand Down
8 changes: 4 additions & 4 deletions pkg/linter/lib/src/rules/always_declare_return_types.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ typedef predicate = bool Function(Object o);
class AlwaysDeclareReturnTypes extends LintRule {
AlwaysDeclareReturnTypes()
: super(
name: 'always_declare_return_types',
description: _desc,
details: _details,
categories: {LintRuleCategory.style});
name: 'always_declare_return_types',
description: _desc,
details: _details,
);

@override
List<LintCode> get lintCodes => [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ when the Dart formatter is used.
class AlwaysPutControlBodyOnNewLine extends LintRule {
AlwaysPutControlBodyOnNewLine()
: super(
name: 'always_put_control_body_on_new_line',
description: _desc,
details: _details,
categories: {LintRuleCategory.style});
name: 'always_put_control_body_on_new_line',
description: _desc,
details: _details,
);

@override
LintCode get lintCode => LinterLintCode.always_put_control_body_on_new_line;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ m({@required a, b, c}) ;
class AlwaysPutRequiredNamedParametersFirst extends LintRule {
AlwaysPutRequiredNamedParametersFirst()
: super(
name: 'always_put_required_named_parameters_first',
description: _desc,
details: _details,
categories: {LintRuleCategory.style});
name: 'always_put_required_named_parameters_first',
description: _desc,
details: _details,
);

@override
LintCode get lintCode =>
Expand Down
Loading

0 comments on commit 4d6ffb4

Please sign in to comment.