Skip to content

Commit

Permalink
Support setting unique names for lint codes
Browse files Browse the repository at this point in the history
Change-Id: I815a519ea0278a6ea33c6f8d83ddac4f3cfd2a58
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153561
Reviewed-by: Phil Quitslund <pquitslund@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
  • Loading branch information
bwilkerson authored and commit-bot@chromium.org committed Jul 8, 2020
1 parent fd432fe commit 018ded5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions pkg/analyzer/lib/src/dart/error/lint_codes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,15 @@ class LintCode extends ErrorCode {
bool operator ==(other) => uniqueName == other.uniqueName;
}

class LintCodeWithUniqueName extends LintCode {
@override
final String uniqueName;

const LintCodeWithUniqueName(String name, this.uniqueName, String message,
{String correction})
: super(name, message, correction: correction);
}

/// Defines security-related best practice recommendations.
///
/// The primary difference from [LintCode]s is that these codes cannot be
Expand All @@ -46,3 +55,13 @@ class SecurityLintCode extends LintCode {
@override
bool get isIgnorable => false;
}

class SecurityLintCodeWithUniqueName extends SecurityLintCode {
@override
final String uniqueName;

const SecurityLintCodeWithUniqueName(
String name, this.uniqueName, String message,
{String correction})
: super(name, message, correction: correction);
}

0 comments on commit 018ded5

Please sign in to comment.