Merge pull request #1977 from scheglov/analyzer-4.5.0

Require analyzer 4.5.0, stop using deprecated APIs.
This commit is contained in:
Simon Binder 2022-08-10 13:51:06 +02:00 committed by GitHub
commit 799db04daa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 17 deletions

View File

@ -67,7 +67,7 @@ class ColumnParser {
if (expr is! FunctionExpressionInvocation) {
base.step.reportError(ErrorInDartCode(
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message: _errorMessage,
severity: Severity.criticalError,
));
@ -106,7 +106,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.warning,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message:
"You're setting more than one name here, the first will "
'be used',
@ -119,7 +119,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.error,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message:
'This table name is cannot be resolved! Please only use '
'a constant string as parameter for .named().',
@ -134,7 +134,7 @@ class ColumnParser {
if (first is! Identifier) {
base.step.reportError(ErrorInDartCode(
message: 'This parameter should be a simple class name',
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
affectedNode: first,
));
break;
@ -144,7 +144,7 @@ class ColumnParser {
if (staticElement is! ClassElement) {
base.step.reportError(ErrorInDartCode(
message: '${first.name} is not a class!',
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
affectedNode: first,
));
break;
@ -154,7 +154,7 @@ class ColumnParser {
if (columnNameNode is! SymbolLiteral) {
base.step.reportError(ErrorInDartCode(
message: 'This should be a symbol literal (`#columnName`)',
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
affectedNode: columnNameNode,
));
break;
@ -170,7 +170,7 @@ class ColumnParser {
base.step.reportError(ErrorInDartCode(
message:
'Should be a direct enum reference (`KeyAction.cascade`)',
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
affectedNode: expr,
));
return null;
@ -209,7 +209,7 @@ class ColumnParser {
columnName,
onUpdate,
onDelete,
getter.declaredElement,
getter.declaredElement2,
first,
columnNameNode,
));
@ -242,7 +242,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.warning,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
affectedNode: remainingExpr.methodName,
message:
"You've already set custom constraints on this column, "
@ -256,7 +256,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.warning,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message:
'This constraint is cannot be resolved! Please only use '
'a constant string as parameter for .customConstraint().',
@ -366,7 +366,7 @@ class ColumnParser {
base.step.reportError(ErrorInDartCode(
message: 'Using $startEnum will apply a custom converter by default, '
"so you can't add an additional converter",
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
severity: Severity.warning,
));
}
@ -378,7 +378,7 @@ class ColumnParser {
} on InvalidTypeForEnumConverterException catch (e) {
base.step.errors.report(ErrorInDartCode(
message: e.errorDescription,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
severity: Severity.error,
));
}
@ -388,7 +388,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.warning,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message: 'clientDefault() and withDefault() are mutually exclusive, '
"they can't both be used. Use clientDefault() for values that "
'are different for each row and withDefault() otherwise.',
@ -401,7 +401,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.error,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message: 'Primary key column cannot have UNIQUE constraint',
),
);
@ -411,7 +411,7 @@ class ColumnParser {
base.step.reportError(
ErrorInDartCode(
severity: Severity.warning,
affectedElement: getter.declaredElement,
affectedElement: getter.declaredElement2,
message: 'This column definition is using both drift-defined '
'constraints (like references, autoIncrement, ...) and a '
'customConstraint(). Only the custom constraint will be added '

View File

@ -63,7 +63,7 @@ class DriftDartParser {
if (body is! ExpressionFunctionBody) {
if (reportErrorOnFailure) {
step.reportError(ErrorInDartCode(
affectedElement: method.declaredElement,
affectedElement: method.declaredElement2,
severity: Severity.criticalError,
message: 'This method must have an expression body '
'(use => instead of {return ...})',

View File

@ -30,7 +30,7 @@ dependencies:
sqlparser: ^0.22.0
# Dart analysis
analyzer: "^4.4.0"
analyzer: "^4.5.0"
analyzer_plugin: ^0.11.0
source_span: ^1.5.5
package_config: ^2.0.0