mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
Allow more information when creating pubspec lints
Change-Id: Icf031b4f57eeb7861ddb9f5aa011087fa002c1ec Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/263681 Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
1b5e8d6c7d
commit
48f33cc37a
|
@ -697,11 +697,20 @@ abstract class LintRule extends Linter implements Comparable<LintRule> {
|
|||
}
|
||||
}
|
||||
|
||||
void reportPubLint(PSNode node) {
|
||||
void reportPubLint(PSNode node,
|
||||
{List<Object> arguments = const [],
|
||||
List<DiagnosticMessage> contextMessages = const [],
|
||||
ErrorCode? errorCode}) {
|
||||
var source = node.source;
|
||||
// Cache error and location info for creating AnalysisErrorInfos
|
||||
AnalysisError error = AnalysisError(
|
||||
source, node.span.start.offset, node.span.length, lintCode);
|
||||
source,
|
||||
node.span.start.offset,
|
||||
node.span.length,
|
||||
errorCode ?? lintCode,
|
||||
arguments,
|
||||
contextMessages,
|
||||
);
|
||||
LineInfo lineInfo = LineInfo.fromContent(source.contents.data);
|
||||
|
||||
_locationInfo.add(AnalysisErrorInfoImpl([error], lineInfo));
|
||||
|
|
Loading…
Reference in a new issue