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

View File

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

View File

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