Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'ignore_for_file: type=lint' to *.g.dart files #1413

Merged
merged 2 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
## vNext (TBD)

### Enhancements
* None
* Suppressing rules for a *.g.dart files ([#1413](https://github.com/realm/realm-dart/pull/1413))

### Fixed
* None
Expand Down
2 changes: 2 additions & 0 deletions example/bin/myapp.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flutter/realm_flutter/example/lib/main.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions generator/lib/src/realm_model_info.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class RealmModelInfo {
const RealmModelInfo(this.name, this.modelName, this.realmName, this.fields, this.baseType);

Iterable<String> toCode() sync* {
yield '// ignore_for_file: type=lint';
yield 'class $name extends $modelName with RealmEntity, RealmObjectBase, ${baseType.className} {';
{
final allSettable = fields.where((f) => !f.type.isRealmCollection && !f.isRealmBacklink).toList();
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class _MappedToo {
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class MappedToo extends _MappedToo
with RealmEntity, RealmObjectBase, RealmObject {
MappedToo({
Expand Down
3 changes: 3 additions & 0 deletions generator/test/good_test_data/all_types.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down Expand Up @@ -49,6 +50,7 @@ class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Bar extends _Bar with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down Expand Up @@ -225,6 +227,7 @@ class Bar extends _Bar with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class PrimitiveTypes extends _PrimitiveTypes
with RealmEntity, RealmObjectBase, RealmObject {
PrimitiveTypes(
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/asymmetric_object.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Asymmetric extends _Asymmetric
with RealmEntity, RealmObjectBase, RealmObject {
Asymmetric(
Expand Down Expand Up @@ -70,6 +71,7 @@ class Asymmetric extends _Asymmetric
}
}

// ignore_for_file: type=lint
class Embedded extends _Embedded
with RealmEntity, RealmObjectBase, EmbeddedObject {
Embedded(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/binary_type.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
Foo(
Uint8List requiredBinaryProp, {
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/embedded_annotations.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
Parent({
Child1? child,
Expand Down Expand Up @@ -50,6 +51,7 @@ class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child1(
String value,
Expand Down
3 changes: 3 additions & 0 deletions generator/test/good_test_data/embedded_objects.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
Parent({
Child1? child,
Expand Down Expand Up @@ -47,6 +48,7 @@ class Parent extends _Parent with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child1(
String value, {
Expand Down Expand Up @@ -111,6 +113,7 @@ class Child1 extends _Child1 with RealmEntity, RealmObjectBase, EmbeddedObject {
}
}

// ignore_for_file: type=lint
class Child2 extends _Child2 with RealmEntity, RealmObjectBase, EmbeddedObject {
Child2(
bool boolProp,
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/indexable_types.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Indexable extends _Indexable
with RealmEntity, RealmObjectBase, RealmObject {
Indexable(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/list_initialization.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person({
Iterable<Person> children = const [],
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/mapto.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Original extends $Original
with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/optional_argument.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person({
Person? spouse,
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/pinhole.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Foo extends _Foo with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down
8 changes: 8 additions & 0 deletions generator/test/good_test_data/primary_key.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class IntPK extends _IntPK with RealmEntity, RealmObjectBase, RealmObject {
IntPK(
int id,
Expand Down Expand Up @@ -33,6 +34,7 @@ class IntPK extends _IntPK with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class NullableIntPK extends _NullableIntPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableIntPK(
Expand Down Expand Up @@ -67,6 +69,7 @@ class NullableIntPK extends _NullableIntPK
}
}

// ignore_for_file: type=lint
class StringPK extends _StringPK
with RealmEntity, RealmObjectBase, RealmObject {
StringPK(
Expand Down Expand Up @@ -99,6 +102,7 @@ class StringPK extends _StringPK
}
}

// ignore_for_file: type=lint
class NullableStringPK extends _NullableStringPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableStringPK(
Expand Down Expand Up @@ -134,6 +138,7 @@ class NullableStringPK extends _NullableStringPK
}
}

// ignore_for_file: type=lint
class ObjectIdPK extends _ObjectIdPK
with RealmEntity, RealmObjectBase, RealmObject {
ObjectIdPK(
Expand Down Expand Up @@ -166,6 +171,7 @@ class ObjectIdPK extends _ObjectIdPK
}
}

// ignore_for_file: type=lint
class NullableObjectIdPK extends _NullableObjectIdPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableObjectIdPK(
Expand Down Expand Up @@ -201,6 +207,7 @@ class NullableObjectIdPK extends _NullableObjectIdPK
}
}

// ignore_for_file: type=lint
class UuidPK extends _UuidPK with RealmEntity, RealmObjectBase, RealmObject {
UuidPK(
Uuid id,
Expand Down Expand Up @@ -232,6 +239,7 @@ class UuidPK extends _UuidPK with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class NullableUuidPK extends _NullableUuidPK
with RealmEntity, RealmObjectBase, RealmObject {
NullableUuidPK(
Expand Down
2 changes: 2 additions & 0 deletions generator/test/good_test_data/realm_set.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Car extends _Car with RealmEntity, RealmObjectBase, RealmObject {
Car(
String make,
Expand Down Expand Up @@ -33,6 +34,7 @@ class Car extends _Car with RealmEntity, RealmObjectBase, RealmObject {
}
}

// ignore_for_file: type=lint
class RealmSets extends _RealmSets
with RealmEntity, RealmObjectBase, RealmObject {
RealmSets(
Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/required_argument.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person(
String name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
static var _defaultsSet = false;

Expand Down
1 change: 1 addition & 0 deletions generator/test/good_test_data/user_defined_getter.expected
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// RealmObjectGenerator
// **************************************************************************

// ignore_for_file: type=lint
class Person extends _Person with RealmEntity, RealmObjectBase, RealmObject {
Person(
String name,
Expand Down
3 changes: 3 additions & 0 deletions test/asymmetric_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/backlinks_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions test/indexed_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/migration_test.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading