Skip to content

Commit 05e77bb

Browse files
committed
Add melos script for tests
1 parent 3e84cfc commit 05e77bb

File tree

7 files changed

+33
-6
lines changed

7 files changed

+33
-6
lines changed

.github/workflows/unit_tests.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

melos.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@ packages:
77
scripts:
88
analyze:
99
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

packages/luthor_annotation/lib/src/validators/max.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ class HasMax {
33
final int max;
44

55
const HasMax(this.max, {this.message});
6-
}
6+
}

packages/luthor_annotation/lib/src/validators/min.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ class HasMin {
33
final int min;
44

55
const HasMin(this.min, {this.message});
6-
}
6+
}

packages/luthor_annotation/lib/src/validators/uri.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ class IsUri {
55
const IsUri({this.allowedSchemes, this.message});
66
}
77

8-
const isUri = IsUri();
8+
const isUri = IsUri();

packages/luthor_generator/lib/generators/luthor_generator.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class LuthorGenerator extends GeneratorForAnnotation<Luthor> {
1919
element: element,
2020
);
2121
}
22-
22+
2323
if (element.constructors.isEmpty) {
2424
throw InvalidGenerationSourceError(
2525
'Luthor can only be applied to classes with at least one constructor.',
@@ -36,7 +36,7 @@ class LuthorGenerator extends GeneratorForAnnotation<Luthor> {
3636
element: element,
3737
);
3838
}
39-
39+
4040
final validateMethod = element.getMethod('validate');
4141
final isInvalidMethod = validateMethod == null ||
4242
!validateMethod.isStatic ||

packages/luthor_generator/lib/helpers/validations/string_validations.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ void _checkAndWriteDateTimeValidation(
2121
ParameterElement param,
2222
) {
2323
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') {
2526
buffer.write('.dateTime(');
2627
final message = dateTimeAnnotation?.getField('message')?.toStringValue();
2728
if (message != null) buffer.write("message: '$message'");

0 commit comments

Comments
 (0)