From 220c7125a33c79ce9a7220e7819c00f0d0cdf736 Mon Sep 17 00:00:00 2001 From: Simon Binder Date: Thu, 16 Nov 2023 21:25:21 +0100 Subject: [PATCH] Update to lints 3.0.0 --- .../snippets/drift_files/custom_queries.dart | 2 +- docs/lib/snippets/migrations/migrations.dart | 2 +- .../migrations/runtime_verification.dart | 4 +-- .../snippets/modular/drift/dart_example.dart | 3 +-- .../snippets/modular/many_to_many/json.dart | 2 +- .../modular/many_to_many/relational.dart | 2 +- docs/lib/snippets/platforms/web.dart | 2 +- docs/pubspec.yaml | 2 +- docs/test/generated/database.dart | 2 +- docs/tool/snippets.dart | 2 +- drift/example/main.dart | 2 +- drift/lib/internal/versioned_schema.dart | 4 +-- drift/lib/native.dart | 13 ++++------ drift/lib/src/remote/client_impl.dart | 6 ++--- drift/lib/src/runtime/api/db_base.dart | 7 +++--- .../query_builder/statements/delete.dart | 3 +-- .../statements/select/select.dart | 5 +--- .../statements/select/select_with_join.dart | 6 ++--- .../query_builder/statements/update.dart | 3 +-- drift/lib/wasm.dart | 4 +-- drift/pubspec.yaml | 2 +- drift/test/database/database_test.dart | 2 +- .../test/database/statements/schema_test.dart | 2 +- drift/test/generated/custom_tables.dart | 2 +- drift/test/generated/todos.dart | 2 +- .../cancellation_test_support.dart | 2 +- .../migrations_integration_test.dart | 3 +-- .../integration_tests/regress_1589_test.dart | 2 +- drift_dev/lib/src/cli/commands/analyze.dart | 2 +- .../src/cli/commands/identify_databases.dart | 2 +- drift_dev/lib/src/cli/commands/migrate.dart | 2 +- .../lib/src/cli/commands/schema/dump.dart | 3 ++- drift_dev/lib/src/writer/modules.dart | 2 +- drift_dev/pubspec.yaml | 2 +- .../services/schema/validate_schema_test.dart | 4 +-- .../services/schema/verifier_impl_test.dart | 2 +- drift_sqflite/pubspec.yaml | 2 +- examples/encryption/lib/main.dart | 6 ++--- examples/encryption/pubspec.yaml | 2 +- examples/migrations_example/lib/database.dart | 2 +- examples/migrations_example/pubspec.yaml | 2 +- examples/modular/pubspec.yaml | 2 +- examples/web_worker_example/pubspec.yaml | 2 +- extras/drift_devtools_extension/pubspec.yaml | 2 +- extras/drift_mariadb/pubspec.yaml | 2 +- .../lib/database/database.dart | 2 +- .../drift_testcases/pubspec.yaml | 2 +- .../integration_tests/web_wasm/pubspec.yaml | 2 +- sqlparser/lib/src/analysis/error.dart | 5 ++-- .../lib/src/ast/schema/column_definition.dart | 25 +++++++++---------- .../lib/src/ast/schema/table_definition.dart | 12 ++++----- sqlparser/lib/src/ast/statements/select.dart | 2 +- sqlparser/lib/src/engine/module/fts5.dart | 6 ++--- sqlparser/lib/src/reader/tokenizer/token.dart | 4 +-- sqlparser/pubspec.yaml | 2 +- 55 files changed, 88 insertions(+), 108 deletions(-) diff --git a/docs/lib/snippets/drift_files/custom_queries.dart b/docs/lib/snippets/drift_files/custom_queries.dart index 852e9b60..1ac5b730 100644 --- a/docs/lib/snippets/drift_files/custom_queries.dart +++ b/docs/lib/snippets/drift_files/custom_queries.dart @@ -29,7 +29,7 @@ class MyDatabase extends $MyDatabase { @override int get schemaVersion => 1; - MyDatabase(QueryExecutor e) : super(e); + MyDatabase(super.e); // #docregion amountOfTodosInCategory Stream amountOfTodosInCategory(int id) { diff --git a/docs/lib/snippets/migrations/migrations.dart b/docs/lib/snippets/migrations/migrations.dart index 49b43259..d025c213 100644 --- a/docs/lib/snippets/migrations/migrations.dart +++ b/docs/lib/snippets/migrations/migrations.dart @@ -18,7 +18,7 @@ class Todos extends Table { @DriftDatabase(tables: [Todos]) class MyDatabase extends _$MyDatabase { - MyDatabase(QueryExecutor e) : super(e); + MyDatabase(super.e); // #docregion start @override diff --git a/docs/lib/snippets/migrations/runtime_verification.dart b/docs/lib/snippets/migrations/runtime_verification.dart index deff357d..5ad716fa 100644 --- a/docs/lib/snippets/migrations/runtime_verification.dart +++ b/docs/lib/snippets/migrations/runtime_verification.dart @@ -8,14 +8,14 @@ import 'package:drift_dev/api/migrations.dart'; const kDebugMode = true; abstract class _$MyDatabase extends GeneratedDatabase { - _$MyDatabase(QueryExecutor executor) : super(executor); + _$MyDatabase(super.executor); } // #docregion class MyDatabase extends _$MyDatabase { // #enddocregion - MyDatabase(QueryExecutor executor) : super(executor); + MyDatabase(super.executor); @override Iterable> get allTables => diff --git a/docs/lib/snippets/modular/drift/dart_example.dart b/docs/lib/snippets/modular/drift/dart_example.dart index b373a6ec..e16360fc 100644 --- a/docs/lib/snippets/modular/drift/dart_example.dart +++ b/docs/lib/snippets/modular/drift/dart_example.dart @@ -1,9 +1,8 @@ -import 'package:drift/drift.dart'; import 'example.drift.dart'; class DartExample extends ExampleDrift { - DartExample(GeneratedDatabase attachedDatabase) : super(attachedDatabase); + DartExample(super.attachedDatabase); // #docregion watchInCategory Stream> watchInCategory(int category) { diff --git a/docs/lib/snippets/modular/many_to_many/json.dart b/docs/lib/snippets/modular/many_to_many/json.dart index 92a9db49..af15e3eb 100644 --- a/docs/lib/snippets/modular/many_to_many/json.dart +++ b/docs/lib/snippets/modular/many_to_many/json.dart @@ -48,7 +48,7 @@ class ShoppingCartEntries { @DriftDatabase(tables: [BuyableItems, ShoppingCarts]) class JsonBasedDatabase extends $JsonBasedDatabase { - JsonBasedDatabase(QueryExecutor e) : super(e); + JsonBasedDatabase(super.e); @override int get schemaVersion => 1; diff --git a/docs/lib/snippets/modular/many_to_many/relational.dart b/docs/lib/snippets/modular/many_to_many/relational.dart index e25f1be8..186358a9 100644 --- a/docs/lib/snippets/modular/many_to_many/relational.dart +++ b/docs/lib/snippets/modular/many_to_many/relational.dart @@ -31,7 +31,7 @@ class ShoppingCartEntries extends Table { @DriftDatabase(tables: [BuyableItems, ShoppingCarts, ShoppingCartEntries]) class RelationalDatabase extends $RelationalDatabase { - RelationalDatabase(QueryExecutor e) : super(e); + RelationalDatabase(super.e); @override int get schemaVersion => 1; diff --git a/docs/lib/snippets/platforms/web.dart b/docs/lib/snippets/platforms/web.dart index 7c63c41a..499e0ff5 100644 --- a/docs/lib/snippets/platforms/web.dart +++ b/docs/lib/snippets/platforms/web.dart @@ -28,7 +28,7 @@ DatabaseConnection connectOnWeb() { // You can then use this method to open your database: class MyWebDatabase extends _$MyWebDatabase { - MyWebDatabase._(QueryExecutor e) : super(e); + MyWebDatabase._(super.e); factory MyWebDatabase() => MyWebDatabase._(connectOnWeb()); // ... diff --git a/docs/pubspec.yaml b/docs/pubspec.yaml index a6b01865..ffe71a9d 100644 --- a/docs/pubspec.yaml +++ b/docs/pubspec.yaml @@ -36,7 +36,7 @@ dependencies: postgres: ^3.0.0-0 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 build: ^2.1.0 build_runner: ^2.0.5 build_runner_core: ^7.2.7 diff --git a/docs/test/generated/database.dart b/docs/test/generated/database.dart index c283cb79..a3ce3974 100644 --- a/docs/test/generated/database.dart +++ b/docs/test/generated/database.dart @@ -11,7 +11,7 @@ class Users extends Table { @DriftDatabase(tables: [Users]) class Database extends _$Database { - Database(QueryExecutor c) : super(c); + Database(super.c); @override int get schemaVersion => 1; diff --git a/docs/tool/snippets.dart b/docs/tool/snippets.dart index bbace20e..21f984b2 100644 --- a/docs/tool/snippets.dart +++ b/docs/tool/snippets.dart @@ -35,7 +35,7 @@ class SnippetsBuilder extends CodeExcerptBuilder { } class _DriftHighlighter extends Highlighter { - _DriftHighlighter(SourceFile file) : super(file); + _DriftHighlighter(super.file); @override void highlight() { diff --git a/drift/example/main.dart b/drift/example/main.dart index a6893780..de746c83 100644 --- a/drift/example/main.dart +++ b/drift/example/main.dart @@ -64,7 +64,7 @@ abstract class TodoItemWithCategoryNameView extends View { TodoItemWithCategoryNameView, ]) class Database extends _$Database { - Database(QueryExecutor e) : super(e); + Database(super.e); @override int get schemaVersion => 2; diff --git a/drift/lib/internal/versioned_schema.dart b/drift/lib/internal/versioned_schema.dart index 7c905f48..c240e91f 100644 --- a/drift/lib/internal/versioned_schema.dart +++ b/drift/lib/internal/versioned_schema.dart @@ -223,9 +223,9 @@ class VersionedVirtualTable extends VersionedTable /// Create a virtual table by copying fields from [source] and applying a /// [alias] to columns. VersionedVirtualTable.aliased( - {required VersionedVirtualTable source, required String? alias}) + {required VersionedVirtualTable super.source, required super.alias}) : moduleAndArgs = source.moduleAndArgs, - super.aliased(source: source, alias: alias); + super.aliased(); @override VersionedVirtualTable createAlias(String alias) { diff --git a/drift/lib/native.dart b/drift/lib/native.dart index cdb1570a..e523df69 100644 --- a/drift/lib/native.dart +++ b/drift/lib/native.dart @@ -48,8 +48,8 @@ class NativeDatabase extends DelegatedDatabase { // when changing this, also update the documentation in `drift_vm_database_factory`. static const _cacheStatementsByDefault = false; - NativeDatabase._(DatabaseDelegate delegate, bool logStatements) - : super(delegate, isSequential: false, logStatements: logStatements); + NativeDatabase._(super.delegate, bool logStatements) + : super(isSequential: false, logStatements: logStatements); /// Creates a database that will store its result in the [file], creating it /// if it doesn't exist. @@ -253,15 +253,12 @@ class _NativeDelegate extends Sqlite3Delegate { ); _NativeDelegate.opened( - Database db, - DatabaseSetup? setup, - bool closeUnderlyingWhenClosed, + Database super.db, + super.setup, + super.closeUnderlyingWhenClosed, bool cachePreparedStatements, ) : file = null, super.opened( - db, - setup, - closeUnderlyingWhenClosed, cachePreparedStatements: cachePreparedStatements, ); diff --git a/drift/lib/src/remote/client_impl.dart b/drift/lib/src/remote/client_impl.dart index 48852955..12459f40 100644 --- a/drift/lib/src/remote/client_impl.dart +++ b/drift/lib/src/remote/client_impl.dart @@ -135,8 +135,7 @@ abstract class _BaseExecutor extends QueryExecutor { } class _RemoteQueryExecutor extends _BaseExecutor { - _RemoteQueryExecutor(DriftClient client, [int? executorId]) - : super(client, executorId); + _RemoteQueryExecutor(super.client, [super.executorId]); Completer? _setSchemaVersion; Future? _serverIsOpen; @@ -181,8 +180,7 @@ class _RemoteTransactionExecutor extends _BaseExecutor implements TransactionExecutor { final int? _outerExecutorId; - _RemoteTransactionExecutor(DriftClient client, this._outerExecutorId) - : super(client); + _RemoteTransactionExecutor(super.client, this._outerExecutorId); Completer? _pendingOpen; bool _done = false; diff --git a/drift/lib/src/runtime/api/db_base.dart b/drift/lib/src/runtime/api/db_base.dart index f13158ce..d0d8d43c 100644 --- a/drift/lib/src/runtime/api/db_base.dart +++ b/drift/lib/src/runtime/api/db_base.dart @@ -59,14 +59,13 @@ abstract class GeneratedDatabase extends DatabaseConnectionUser final Type _$dontSendThisOverIsolates = Null; /// Used by generated code - GeneratedDatabase(QueryExecutor executor, {StreamQueryStore? streamStore}) - : super(executor, streamQueries: streamStore) { + GeneratedDatabase(super.executor, {StreamQueryStore? streamStore}) + : super(streamQueries: streamStore) { _whenConstructed(); } /// Used by generated code to connect to a database that is already open. - GeneratedDatabase.connect(DatabaseConnection connection) - : super.fromConnection(connection) { + GeneratedDatabase.connect(super.connection) : super.fromConnection() { _whenConstructed(); } diff --git a/drift/lib/src/runtime/query_builder/statements/delete.dart b/drift/lib/src/runtime/query_builder/statements/delete.dart index 732ff60d..978c8430 100644 --- a/drift/lib/src/runtime/query_builder/statements/delete.dart +++ b/drift/lib/src/runtime/query_builder/statements/delete.dart @@ -5,8 +5,7 @@ class DeleteStatement extends Query with SingleTableQueryMixin { /// This constructor should be called by [DatabaseConnectionUser.delete] for /// you. - DeleteStatement(DatabaseConnectionUser database, TableInfo table) - : super(database, table); + DeleteStatement(super.database, TableInfo super.table); @override void writeStartPart(GenerationContext ctx) { diff --git a/drift/lib/src/runtime/query_builder/statements/select/select.dart b/drift/lib/src/runtime/query_builder/statements/select/select.dart index b73b873f..3b834b93 100644 --- a/drift/lib/src/runtime/query_builder/statements/select/select.dart +++ b/drift/lib/src/runtime/query_builder/statements/select/select.dart @@ -30,10 +30,7 @@ class SimpleSelectStatement extends Query /// Used internally by drift, users will want to call /// [DatabaseConnectionUser.select] instead. - SimpleSelectStatement( - DatabaseConnectionUser database, ResultSetImplementation table, - {this.distinct = false}) - : super(database, table); + SimpleSelectStatement(super.database, super.table, {this.distinct = false}); /// The tables this select statement reads from. @visibleForOverriding diff --git a/drift/lib/src/runtime/query_builder/statements/select/select_with_join.dart b/drift/lib/src/runtime/query_builder/statements/select/select_with_join.dart index 4df6e637..ac7a6edc 100644 --- a/drift/lib/src/runtime/query_builder/statements/select/select_with_join.dart +++ b/drift/lib/src/runtime/query_builder/statements/select/select_with_join.dart @@ -10,12 +10,10 @@ class JoinedSelectStatement implements BaseSelectStatement { /// Used internally by drift, users should use [SimpleSelectStatement.join] /// instead. - JoinedSelectStatement(DatabaseConnectionUser database, - ResultSetImplementation table, this._joins, + JoinedSelectStatement(super.database, super.table, this._joins, [this.distinct = false, this._includeMainTableInResult = true, - this._includeJoinedTablesInResult = true]) - : super(database, table); + this._includeJoinedTablesInResult = true]); /// Whether to generate a `SELECT DISTINCT` query that will remove duplicate /// rows from the result set. diff --git a/drift/lib/src/runtime/query_builder/statements/update.dart b/drift/lib/src/runtime/query_builder/statements/update.dart index f1b35989..d87b0d9d 100644 --- a/drift/lib/src/runtime/query_builder/statements/update.dart +++ b/drift/lib/src/runtime/query_builder/statements/update.dart @@ -4,8 +4,7 @@ part of '../query_builder.dart'; class UpdateStatement extends Query with SingleTableQueryMixin { /// Used internally by drift, construct an update statement - UpdateStatement(DatabaseConnectionUser database, TableInfo table) - : super(database, table); + UpdateStatement(super.database, TableInfo super.table); late Map _updatedFields; diff --git a/drift/lib/wasm.dart b/drift/lib/wasm.dart index c66893a1..4bf9924d 100644 --- a/drift/lib/wasm.dart +++ b/drift/lib/wasm.dart @@ -31,8 +31,8 @@ export 'src/web/wasm_setup/types.dart'; /// how to obtain this file. A [working example](https://github.com/simolus3/drift/blob/04539882330d80519128fec1ceb120fb1623a831/examples/app/lib/database/connection/web.dart#L27-L36) /// is also available in the drift repository. class WasmDatabase extends DelegatedDatabase { - WasmDatabase._(DatabaseDelegate delegate, bool logStatements) - : super(delegate, isSequential: true, logStatements: logStatements); + WasmDatabase._(super.delegate, bool logStatements) + : super(isSequential: true, logStatements: logStatements); /// Creates a wasm database at [path] in the virtual file system of the /// [sqlite3] module. diff --git a/drift/pubspec.yaml b/drift/pubspec.yaml index fa0472b8..3744cb6c 100644 --- a/drift/pubspec.yaml +++ b/drift/pubspec.yaml @@ -28,7 +28,7 @@ dev_dependencies: drift_testcases: path: ../extras/integration_tests/drift_testcases http: ^0.13.4 - lints: ^2.0.0 + lints: ^3.0.0 uuid: ^4.0.0 build_runner: ^2.0.0 test: ^1.17.0 diff --git a/drift/test/database/database_test.dart b/drift/test/database/database_test.dart index c5c18a44..fe8943d7 100644 --- a/drift/test/database/database_test.dart +++ b/drift/test/database/database_test.dart @@ -6,7 +6,7 @@ import '../generated/todos.dart'; import '../test_utils/test_utils.dart'; class _FakeDb extends GeneratedDatabase { - _FakeDb(QueryExecutor executor) : super(executor); + _FakeDb(super.executor); @override MigrationStrategy get migration { diff --git a/drift/test/database/statements/schema_test.dart b/drift/test/database/statements/schema_test.dart index bdb0606a..73ee2f56 100644 --- a/drift/test/database/statements/schema_test.dart +++ b/drift/test/database/statements/schema_test.dart @@ -321,7 +321,7 @@ final class _FakeSchemaVersion extends VersionedSchema { } class _DefaultDb extends GeneratedDatabase { - _DefaultDb(QueryExecutor executor) : super(executor); + _DefaultDb(super.executor); @override List> get allTables => []; diff --git a/drift/test/generated/custom_tables.dart b/drift/test/generated/custom_tables.dart index 6c565ebd..6504bc72 100644 --- a/drift/test/generated/custom_tables.dart +++ b/drift/test/generated/custom_tables.dart @@ -15,7 +15,7 @@ part 'custom_tables.g.dart'; }, ) class CustomTablesDb extends _$CustomTablesDb { - CustomTablesDb(QueryExecutor e) : super(e) { + CustomTablesDb(super.e) { driftRuntimeOptions.dontWarnAboutMultipleDatabases = true; } diff --git a/drift/test/generated/todos.dart b/drift/test/generated/todos.dart index 43509b3e..e5c4e0a8 100644 --- a/drift/test/generated/todos.dart +++ b/drift/test/generated/todos.dart @@ -257,7 +257,7 @@ class TodoDb extends _$TodoDb { }, ) class SomeDao extends DatabaseAccessor with _$SomeDaoMixin { - SomeDao(TodoDb db) : super(db); + SomeDao(super.db); } QueryExecutor get _nullExecutor => diff --git a/drift/test/integration_tests/cancellation_test_support.dart b/drift/test/integration_tests/cancellation_test_support.dart index f49808f5..924bfab4 100644 --- a/drift/test/integration_tests/cancellation_test_support.dart +++ b/drift/test/integration_tests/cancellation_test_support.dart @@ -35,7 +35,7 @@ DatabaseConnection createConnection() { } class EmptyDb extends GeneratedDatabase { - EmptyDb(DatabaseConnection c) : super(c); + EmptyDb(DatabaseConnection super.c); @override final List allTables = const []; @override diff --git a/drift/test/integration_tests/migrations_integration_test.dart b/drift/test/integration_tests/migrations_integration_test.dart index 76ea82ef..80d19881 100644 --- a/drift/test/integration_tests/migrations_integration_test.dart +++ b/drift/test/integration_tests/migrations_integration_test.dart @@ -495,8 +495,7 @@ void main() { } class _TestDatabase extends GeneratedDatabase { - _TestDatabase(QueryExecutor executor, this.schemaVersion, this.migration) - : super(executor); + _TestDatabase(super.executor, this.schemaVersion, this.migration); @override Iterable> get allTables => const Iterable.empty(); diff --git a/drift/test/integration_tests/regress_1589_test.dart b/drift/test/integration_tests/regress_1589_test.dart index 6baa30ea..b0f2fc2b 100644 --- a/drift/test/integration_tests/regress_1589_test.dart +++ b/drift/test/integration_tests/regress_1589_test.dart @@ -61,7 +61,7 @@ CREATE TABLE IF NOT EXISTS todo_categories ( } class _Database extends GeneratedDatabase { - _Database(QueryExecutor executor) : super(executor); + _Database(super.executor); @override Iterable> get allTables => const Iterable.empty(); diff --git a/drift_dev/lib/src/cli/commands/analyze.dart b/drift_dev/lib/src/cli/commands/analyze.dart index 7aef845b..fde0663c 100644 --- a/drift_dev/lib/src/cli/commands/analyze.dart +++ b/drift_dev/lib/src/cli/commands/analyze.dart @@ -3,7 +3,7 @@ import 'dart:io'; import '../cli.dart'; class AnalyzeCommand extends MoorCommand { - AnalyzeCommand(DriftDevCli cli) : super(cli); + AnalyzeCommand(super.cli); @override String get description => 'Analyze and lint drift database code'; diff --git a/drift_dev/lib/src/cli/commands/identify_databases.dart b/drift_dev/lib/src/cli/commands/identify_databases.dart index 065e31f9..0ef0ea5b 100644 --- a/drift_dev/lib/src/cli/commands/identify_databases.dart +++ b/drift_dev/lib/src/cli/commands/identify_databases.dart @@ -7,7 +7,7 @@ import '../../analysis/results/results.dart'; import '../cli.dart'; class IdentifyDatabases extends MoorCommand { - IdentifyDatabases(DriftDevCli cli) : super(cli); + IdentifyDatabases(super.cli); @override String get description => diff --git a/drift_dev/lib/src/cli/commands/migrate.dart b/drift_dev/lib/src/cli/commands/migrate.dart index 2c446bf4..771eac1b 100644 --- a/drift_dev/lib/src/cli/commands/migrate.dart +++ b/drift_dev/lib/src/cli/commands/migrate.dart @@ -26,7 +26,7 @@ class MigrateCommand extends MoorCommand { late final AnalysisContext context; - MigrateCommand(DriftDevCli cli) : super(cli); + MigrateCommand(super.cli); @override String get description => 'Migrate a project from moor to drift'; diff --git a/drift_dev/lib/src/cli/commands/schema/dump.dart b/drift_dev/lib/src/cli/commands/schema/dump.dart index feedd5d4..2c530a54 100644 --- a/drift_dev/lib/src/cli/commands/schema/dump.dart +++ b/drift_dev/lib/src/cli/commands/schema/dump.dart @@ -86,7 +86,8 @@ class DumpSchemaCommand extends Command { try { final elements = await extractDriftElementsFromDatabase(opened); - final userVersion = opened.select('pragma user_version').single[0] as int; + final userVersion = + opened.select('pragma user_version').single.columnAt(0) as int; return _AnalyzedDatabase(elements, userVersion); } finally { diff --git a/drift_dev/lib/src/writer/modules.dart b/drift_dev/lib/src/writer/modules.dart index b06464cb..63de81fc 100644 --- a/drift_dev/lib/src/writer/modules.dart +++ b/drift_dev/lib/src/writer/modules.dart @@ -85,7 +85,7 @@ class ModularAccessorWriter { // Also make imports available final imports = file.discovery?.importDependencies ?? const []; for (final import in imports) { - final file = driver.cache.knownFiles[import]; + final file = driver.cache.knownFiles[import.uri]; if (file != null && file.needsModularAccessor(driver)) { final moduleClass = restOfClass.modularAccessor(import.uri); diff --git a/drift_dev/pubspec.yaml b/drift_dev/pubspec.yaml index fa4ac25c..b0dd5684 100644 --- a/drift_dev/pubspec.yaml +++ b/drift_dev/pubspec.yaml @@ -50,7 +50,7 @@ dependencies: string_scanner: ^1.1.1 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 checked_yaml: ^2.0.1 test: ^1.16.0 test_descriptor: ^2.0.0 diff --git a/drift_dev/test/services/schema/validate_schema_test.dart b/drift_dev/test/services/schema/validate_schema_test.dart index df568e06..578976d9 100644 --- a/drift_dev/test/services/schema/validate_schema_test.dart +++ b/drift_dev/test/services/schema/validate_schema_test.dart @@ -42,8 +42,8 @@ class _TestDatabase extends GeneratedDatabase { @override DriftDatabaseOptions options = DriftDatabaseOptions(); - _TestDatabase.connect(DatabaseConnection connection) - : super.connect(connection); + _TestDatabase.connect(super.connection) + : super.connect(); } void main() { diff --git a/drift_dev/test/services/schema/verifier_impl_test.dart b/drift_dev/test/services/schema/verifier_impl_test.dart index 7f2e2814..b9536fcf 100644 --- a/drift_dev/test/services/schema/verifier_impl_test.dart +++ b/drift_dev/test/services/schema/verifier_impl_test.dart @@ -80,7 +80,7 @@ class _TestDatabase extends GeneratedDatabase { @override MigrationStrategy migration = MigrationStrategy(); - _TestDatabase(QueryExecutor executor, this.schemaVersion) : super(executor); + _TestDatabase(super.executor, this.schemaVersion); @override Iterable> get allTables { diff --git a/drift_sqflite/pubspec.yaml b/drift_sqflite/pubspec.yaml index e9818ee7..7b112370 100644 --- a/drift_sqflite/pubspec.yaml +++ b/drift_sqflite/pubspec.yaml @@ -18,7 +18,7 @@ dependencies: dev_dependencies: integration_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.0 flutter_test: sdk: flutter drift_testcases: diff --git a/examples/encryption/lib/main.dart b/examples/encryption/lib/main.dart index 25c38d12..6445b5b1 100644 --- a/examples/encryption/lib/main.dart +++ b/examples/encryption/lib/main.dart @@ -19,7 +19,7 @@ void main() { } class MyApp extends StatelessWidget { - const MyApp({Key? key}) : super(key: key); + const MyApp({super.key}); @override Widget build(BuildContext context) { @@ -35,7 +35,7 @@ class MyApp extends StatelessWidget { } class HomePage extends StatefulWidget { - const HomePage({Key? key}) : super(key: key); + const HomePage({super.key}); @override State createState() => _HomePageState(); @@ -95,7 +95,7 @@ class _AddEntryDialog extends StatefulWidget { // database around, but tiny example only wants to show how to use encryption. final MyEncryptedDatabase database; - const _AddEntryDialog({Key? key, required this.database}) : super(key: key); + const _AddEntryDialog({required this.database}); @override State<_AddEntryDialog> createState() => _AddEntryDialogState(); diff --git a/examples/encryption/pubspec.yaml b/examples/encryption/pubspec.yaml index 5455c1fa..e0b4e254 100644 --- a/examples/encryption/pubspec.yaml +++ b/examples/encryption/pubspec.yaml @@ -19,7 +19,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.0 drift_dev: ^2.0.2 build_runner: ^2.2.0 diff --git a/examples/migrations_example/lib/database.dart b/examples/migrations_example/lib/database.dart index 2476b51d..8d630666 100644 --- a/examples/migrations_example/lib/database.dart +++ b/examples/migrations_example/lib/database.dart @@ -21,7 +21,7 @@ class Database extends _$Database { @override int get schemaVersion => latestSchemaVersion; - Database(DatabaseConnection connection) : super(connection); + Database(DatabaseConnection super.connection); @override MigrationStrategy get migration { diff --git a/examples/migrations_example/pubspec.yaml b/examples/migrations_example/pubspec.yaml index e3a9427b..87d9a475 100644 --- a/examples/migrations_example/pubspec.yaml +++ b/examples/migrations_example/pubspec.yaml @@ -10,6 +10,6 @@ dependencies: drift_dev: dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 build_runner: ^2.0.0 test: ^1.15.4 diff --git a/examples/modular/pubspec.yaml b/examples/modular/pubspec.yaml index cc254f05..1f170cdc 100644 --- a/examples/modular/pubspec.yaml +++ b/examples/modular/pubspec.yaml @@ -11,5 +11,5 @@ dependencies: dev_dependencies: build_runner: ^2.3.2 drift_dev: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.16.0 diff --git a/examples/web_worker_example/pubspec.yaml b/examples/web_worker_example/pubspec.yaml index 18c689f8..01f9e3a9 100644 --- a/examples/web_worker_example/pubspec.yaml +++ b/examples/web_worker_example/pubspec.yaml @@ -14,5 +14,5 @@ dependencies: dev_dependencies: build_runner: ^2.1.11 build_web_compilers: ^4.0.0 - lints: ^2.0.0 + lints: ^3.0.0 drift_dev: diff --git a/extras/drift_devtools_extension/pubspec.yaml b/extras/drift_devtools_extension/pubspec.yaml index 5b23e967..3774e060 100644 --- a/extras/drift_devtools_extension/pubspec.yaml +++ b/extras/drift_devtools_extension/pubspec.yaml @@ -27,7 +27,7 @@ dependencies: dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^2.0.0 + flutter_lints: ^3.0.0 flutter: uses-material-design: true diff --git a/extras/drift_mariadb/pubspec.yaml b/extras/drift_mariadb/pubspec.yaml index 939c8497..40aa1fe7 100644 --- a/extras/drift_mariadb/pubspec.yaml +++ b/extras/drift_mariadb/pubspec.yaml @@ -11,7 +11,7 @@ dependencies: mysql_client: ^0.0.27 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.21.0 drift_testcases: path: ../integration_tests/drift_testcases diff --git a/extras/integration_tests/drift_testcases/lib/database/database.dart b/extras/integration_tests/drift_testcases/lib/database/database.dart index b285842c..4a884c5a 100644 --- a/extras/integration_tests/drift_testcases/lib/database/database.dart +++ b/extras/integration_tests/drift_testcases/lib/database/database.dart @@ -88,7 +88,7 @@ class Database extends _$Database { @override final int schemaVersion; - Database(DatabaseConnection e, {this.schemaVersion = 2}) : super(e); + Database(DatabaseConnection super.e, {this.schemaVersion = 2}); Database.executor(QueryExecutor db) : this(DatabaseConnection(db)); diff --git a/extras/integration_tests/drift_testcases/pubspec.yaml b/extras/integration_tests/drift_testcases/pubspec.yaml index 9bec7f09..b28407a5 100644 --- a/extras/integration_tests/drift_testcases/pubspec.yaml +++ b/extras/integration_tests/drift_testcases/pubspec.yaml @@ -15,4 +15,4 @@ dev_dependencies: build_runner: ^2.1.11 drift_dev: ^2.0.0 json_serializable: ^6.2.0 - lints: ^2.0.0 + lints: ^3.0.0 diff --git a/extras/integration_tests/web_wasm/pubspec.yaml b/extras/integration_tests/web_wasm/pubspec.yaml index 36f25afb..a7d1acdf 100644 --- a/extras/integration_tests/web_wasm/pubspec.yaml +++ b/extras/integration_tests/web_wasm/pubspec.yaml @@ -23,5 +23,5 @@ dev_dependencies: build_runner: ^2.4.5 build_web_compilers: ^4.0.0 drift_dev: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.24.3 diff --git a/sqlparser/lib/src/analysis/error.dart b/sqlparser/lib/src/analysis/error.dart index 9f742903..9bcd8e3e 100644 --- a/sqlparser/lib/src/analysis/error.dart +++ b/sqlparser/lib/src/analysis/error.dart @@ -44,11 +44,10 @@ class UnresolvedReferenceError extends AnalysisError { final Iterable available; UnresolvedReferenceError( - {required AnalysisErrorType type, + {required super.type, required this.reference, required this.available, - AstNode? relevantNode}) - : super(type: type, relevantNode: relevantNode); + AstNode? super.relevantNode}); @override String get message { diff --git a/sqlparser/lib/src/ast/schema/column_definition.dart b/sqlparser/lib/src/ast/schema/column_definition.dart index dab8b7e3..d9ce13c7 100644 --- a/sqlparser/lib/src/ast/schema/column_definition.dart +++ b/sqlparser/lib/src/ast/schema/column_definition.dart @@ -95,7 +95,7 @@ class NullColumnConstraint extends ColumnConstraint { /// The `NULL` token forming this constraint. Token? $null; - NullColumnConstraint(String? name, {this.$null}) : super(name); + NullColumnConstraint(super.name, {this.$null}); @override Iterable get childNodes => const Iterable.empty(); @@ -110,7 +110,7 @@ class NotNull extends ColumnConstraint { Token? not; Token? $null; - NotNull(String? name, {this.onConflict}) : super(name); + NotNull(super.name, {this.onConflict}); @override final Iterable childNodes = const []; @@ -124,9 +124,8 @@ class PrimaryKeyColumn extends ColumnConstraint { final ConflictClause? onConflict; final OrderingMode? mode; - PrimaryKeyColumn(String? name, - {this.autoIncrement = false, this.mode, this.onConflict}) - : super(name); + PrimaryKeyColumn(super.name, + {this.autoIncrement = false, this.mode, this.onConflict}); @override Iterable get childNodes => const []; @@ -138,7 +137,7 @@ class PrimaryKeyColumn extends ColumnConstraint { class UniqueColumn extends ColumnConstraint { final ConflictClause? onConflict; - UniqueColumn(String? name, this.onConflict) : super(name); + UniqueColumn(super.name, this.onConflict); @override Iterable get childNodes => const []; @@ -150,7 +149,7 @@ class UniqueColumn extends ColumnConstraint { class CheckColumn extends ColumnConstraint { Expression expression; - CheckColumn(String? name, this.expression) : super(name); + CheckColumn(super.name, this.expression); @override Iterable get childNodes => [expression]; @@ -164,7 +163,7 @@ class CheckColumn extends ColumnConstraint { class Default extends ColumnConstraint { Expression expression; - Default(String? name, this.expression) : super(name); + Default(super.name, this.expression); @override Iterable get childNodes => [expression]; @@ -178,7 +177,7 @@ class Default extends ColumnConstraint { class CollateConstraint extends ColumnConstraint { final String collation; - CollateConstraint(String? name, this.collation) : super(name); + CollateConstraint(super.name, this.collation); @override final Iterable childNodes = const []; @@ -190,7 +189,7 @@ class CollateConstraint extends ColumnConstraint { class ForeignKeyColumnConstraint extends ColumnConstraint { ForeignKeyClause clause; - ForeignKeyColumnConstraint(String? name, this.clause) : super(name); + ForeignKeyColumnConstraint(super.name, this.clause); @override Iterable get childNodes => [clause]; @@ -223,7 +222,7 @@ class MappedBy extends ColumnConstraint { /// The Dart expression creating the type converter we use to map this token. final InlineDartToken mapper; - MappedBy(String? name, this.mapper) : super(name); + MappedBy(super.name, this.mapper); @override final Iterable childNodes = const []; @@ -243,7 +242,7 @@ class JsonKey extends ColumnConstraint { String get jsonKey => jsonNameToken.identifier; - JsonKey(String? name, this.jsonNameToken) : super(name); + JsonKey(super.name, this.jsonNameToken); @override void transformChildren(Transformer transformer, A arg) {} @@ -259,7 +258,7 @@ class DriftDartName extends ColumnConstraint { String get dartName => identifier.identifier; - DriftDartName(String? name, this.identifier) : super(name); + DriftDartName(super.name, this.identifier); @override void transformChildren(Transformer transformer, A arg) {} diff --git a/sqlparser/lib/src/ast/schema/table_definition.dart b/sqlparser/lib/src/ast/schema/table_definition.dart index 1a00c68a..4fb6944e 100644 --- a/sqlparser/lib/src/ast/schema/table_definition.dart +++ b/sqlparser/lib/src/ast/schema/table_definition.dart @@ -97,9 +97,8 @@ class KeyClause extends TableConstraint { ]; } - KeyClause(String? name, - {required this.isPrimaryKey, required this.columns, this.onConflict}) - : super(name); + KeyClause(super.name, + {required this.isPrimaryKey, required this.columns, this.onConflict}); @override bool constraintEquals(KeyClause other) { @@ -118,7 +117,7 @@ class KeyClause extends TableConstraint { class CheckTable extends TableConstraint { Expression expression; - CheckTable(String? name, this.expression) : super(name); + CheckTable(super.name, this.expression); @override bool constraintEquals(CheckTable other) => true; @@ -136,9 +135,8 @@ class ForeignKeyTableConstraint extends TableConstraint { List columns; ForeignKeyClause clause; - ForeignKeyTableConstraint(String? name, - {required this.columns, required this.clause}) - : super(name); + ForeignKeyTableConstraint(super.name, + {required this.columns, required this.clause}); @override bool constraintEquals(ForeignKeyTableConstraint other) => true; diff --git a/sqlparser/lib/src/ast/statements/select.dart b/sqlparser/lib/src/ast/statements/select.dart index dc06d047..1786d21c 100644 --- a/sqlparser/lib/src/ast/statements/select.dart +++ b/sqlparser/lib/src/ast/statements/select.dart @@ -8,7 +8,7 @@ abstract class BaseSelectStatement extends CrudStatement with ResultSet { @override List? resolvedColumns; - BaseSelectStatement._(WithClause? withClause) : super(withClause); + BaseSelectStatement._(super.withClause); } /// Marker interface for classes that are a [BaseSelectStatement] but aren't a diff --git a/sqlparser/lib/src/engine/module/fts5.dart b/sqlparser/lib/src/engine/module/fts5.dart index a73e082a..deb5f6f2 100644 --- a/sqlparser/lib/src/engine/module/fts5.dart +++ b/sqlparser/lib/src/engine/module/fts5.dart @@ -114,20 +114,18 @@ class Fts5Table extends Table { final String? contentRowId; Fts5Table({ - required String name, + required super.name, required List columns, this.contentTable, this.contentRowId, - CreateVirtualTableStatement? definition, + CreateVirtualTableStatement? super.definition, }) : super( - name: name, resolvedColumns: [ if (contentTable != null && contentRowId != null) RowId(), ...columns, _Fts5RankColumn(), _Fts5TableColumn(name), ], - definition: definition, isVirtual: true, ); } diff --git a/sqlparser/lib/src/reader/tokenizer/token.dart b/sqlparser/lib/src/reader/tokenizer/token.dart index b7a1f5ef..072447ea 100644 --- a/sqlparser/lib/src/reader/tokenizer/token.dart +++ b/sqlparser/lib/src/reader/tokenizer/token.dart @@ -508,7 +508,7 @@ class IdentifierToken extends Token { } abstract class VariableToken extends Token { - VariableToken(TokenType type, FileSpan span) : super(type, span); + VariableToken(super.type, super.span); } class QuestionMarkVariableToken extends Token { @@ -559,7 +559,7 @@ class KeywordToken extends Token { /// Whether this token has been used as an identifier while parsing. bool isIdentifier = false; - KeywordToken(TokenType type, FileSpan span) : super(type, span); + KeywordToken(super.type, super.span); bool canConvertToIdentifier() { // https://stackoverflow.com/a/45775719, but we don't parse indexed yet. diff --git a/sqlparser/pubspec.yaml b/sqlparser/pubspec.yaml index 56ab6dfb..81b78adf 100644 --- a/sqlparser/pubspec.yaml +++ b/sqlparser/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: charcode: ^1.2.0 dev_dependencies: - lints: ^2.0.0 + lints: ^3.0.0 test: ^1.17.4 path: ^1.8.0 ffi: ^2.0.0