File tree 7 files changed +33
-6
lines changed
luthor_annotation/lib/src/validators
7 files changed +33
-6
lines changed Original file line number Diff line number Diff line change
1
+ name : Unit Tests
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ branches :
7
+ - main
8
+
9
+ jobs :
10
+ test :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@v2
14
+ - uses : dart-lang/setup-dart@v1
15
+ - run : dart pub global activate melos
16
+ - run : melos bootstrap
17
+ - run : melos test
Original file line number Diff line number Diff line change @@ -7,3 +7,12 @@ packages:
7
7
scripts :
8
8
analyze :
9
9
run : dart analyze
10
+
11
+ format :
12
+ run : dart format --set-exit-if-changed .
13
+
14
+ test :
15
+ exec : dart test
16
+ packageFilters :
17
+ scope :
18
+ - luthor
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ class HasMax {
3
3
final int max;
4
4
5
5
const HasMax (this .max, {this .message});
6
- }
6
+ }
Original file line number Diff line number Diff line change @@ -3,4 +3,4 @@ class HasMin {
3
3
final int min;
4
4
5
5
const HasMin (this .min, {this .message});
6
- }
6
+ }
Original file line number Diff line number Diff line change @@ -5,4 +5,4 @@ class IsUri {
5
5
const IsUri ({this .allowedSchemes, this .message});
6
6
}
7
7
8
- const isUri = IsUri ();
8
+ const isUri = IsUri ();
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class LuthorGenerator extends GeneratorForAnnotation<Luthor> {
19
19
element: element,
20
20
);
21
21
}
22
-
22
+
23
23
if (element.constructors.isEmpty) {
24
24
throw InvalidGenerationSourceError (
25
25
'Luthor can only be applied to classes with at least one constructor.' ,
@@ -36,7 +36,7 @@ class LuthorGenerator extends GeneratorForAnnotation<Luthor> {
36
36
element: element,
37
37
);
38
38
}
39
-
39
+
40
40
final validateMethod = element.getMethod ('validate' );
41
41
final isInvalidMethod = validateMethod == null ||
42
42
! validateMethod.isStatic ||
Original file line number Diff line number Diff line change @@ -21,7 +21,8 @@ void _checkAndWriteDateTimeValidation(
21
21
ParameterElement param,
22
22
) {
23
23
final dateTimeAnnotation = getAnnotation (isDateTimeChecker, param);
24
- if (dateTimeAnnotation != null || param.type.getDisplayString (withNullability: false ) == 'DateTime' ) {
24
+ if (dateTimeAnnotation != null ||
25
+ param.type.getDisplayString (withNullability: false ) == 'DateTime' ) {
25
26
buffer.write ('.dateTime(' );
26
27
final message = dateTimeAnnotation? .getField ('message' )? .toStringValue ();
27
28
if (message != null ) buffer.write ("message: '$message '" );
You can’t perform that action at this time.
0 commit comments