Skip to content

Commit 114581d

Browse files
authored
ci: husky integration (#367)
1 parent 1834254 commit 114581d

File tree

14 files changed

+45
-19
lines changed

14 files changed

+45
-19
lines changed

.husky/pre-commit

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env sh
2+
3+
. "$(dirname -- "$0")/_/husky.sh"
4+
5+
# Find the absolute path to the fvm command
6+
FVM_PATH=$(command -v fvm)
7+
8+
# Check if fvm command is found
9+
if [ -n "$FVM_PATH" ]; then
10+
# Add the directory containing the fvm command to PATH
11+
export PATH="$(dirname "$FVM_PATH"):$PATH"
12+
else
13+
echo "FVM not found. Please make sure it is installed and accessible."
14+
exit 1
15+
fi
16+
17+
dart run lint_staged
18+
19+
20+
# dart format --line-length 80 --set-exit-if-changed lib test
21+
# dart analyze --fatal-infos --fatal-warnings lib test
22+
# dart test
23+
24+
# branch_name=$(git rev-parse --abbrev-ref HEAD)
25+
26+
# if ! [[ $branch_name =~ ^(feat/|fix/|docs/|style/|refactor/|perf/|test/|build/|ci/|chore/|revert/).+ ]]; then
27+
# echo "Invalid branch name. Branch names must start with one of the following prefixes followed by a forward slash:"
28+
# echo "feat/, fix/, docs/, style/, refactor/, perf/, test/, build/, ci/, chore/, revert/"
29+
# echo "Example: feat/new-feature"
30+
# exit 1
31+
# fi
32+
33+

packages/mix/lib/src/attributes/animated/animated_util.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ final class AnimatedUtility<T extends Attribute>
1313
DurationUtility<T> get duration => DurationUtility((v) => only(duration: v));
1414

1515
CurveUtility<T> get curve => CurveUtility((v) => only(curve: v));
16-
1716
@override
1817
T only({Duration? duration, Curve? curve}) {
1918
return builder(AnimatedDataDto(duration: duration, curve: curve));

packages/mix/lib/src/attributes/border/border_dto.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ sealed class BoxBorderDto<T extends BoxBorder> extends Dto<T> {
4848
bool get isUniform;
4949

5050
bool get isDirectional => this is BorderDirectionalDto;
51-
5251
@override
5352
BoxBorderDto<T> merge(covariant BoxBorderDto<T>? other);
5453
}

packages/mix/lib/src/attributes/border/border_radius_dto.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ sealed class BorderRadiusGeometryDto<T extends BorderRadiusGeometry>
3535
Radius? get topEnd;
3636
Radius? get bottomStart;
3737
Radius? get bottomEnd;
38-
3938
@override
4039
BorderRadiusGeometryDto<T> merge(covariant BorderRadiusGeometryDto<T>? other);
4140

packages/mix/lib/src/attributes/border/shape_border_dto.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ sealed class ShapeBorderDto<T extends ShapeBorder> extends Dto<T> {
4646
StadiumBorderDto toStadiumBorder();
4747
StarBorderDto toStar();
4848
LinearBorderDto toLinear();
49-
5049
@override
5150
ShapeBorderDto<T> merge(covariant ShapeBorderDto<T>? other);
5251

@@ -201,7 +200,6 @@ final class ContinuousRectangleBorderDto
201200

202201
@override
203202
BorderRadiusGeometryDto? get _borderRadius => borderRadius;
204-
205203
@override
206204
ContinuousRectangleBorder get defaultValue =>
207205
const ContinuousRectangleBorder();

packages/mix/lib/src/attributes/color/color_util.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ base class FoundationColorUtility<T extends Attribute, C extends Color>
2424
const FoundationColorUtility(super.builder, this.color);
2525

2626
T call() => _buildColor(color);
27-
2827
@override
2928
T directive(ColorDirective directive) =>
3029
builder(ColorDto.raw(value: color, directives: [directive]));

packages/mix/lib/src/attributes/decoration/decoration_dto.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ sealed class DecorationDto<T extends Decoration> extends Dto<T> {
7878
bool get isMergeable;
7979

8080
DecorationDto? mergeableDecor(covariant DecorationDto? other);
81-
8281
@override
8382
DecorationDto<T> merge(covariant DecorationDto<T>? other);
8483
}
@@ -163,7 +162,6 @@ final class ShapeDecorationDto extends DecorationDto<ShapeDecoration>
163162
}) : super(boxShadow: shadows);
164163

165164
List<BoxShadowDto>? get shadows => boxShadow;
166-
167165
@override
168166
ShapeDecorationDto mergeableDecor(BoxDecorationDto? other) {
169167
if (other == null) return this;

packages/mix/lib/src/core/attribute.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ abstract base class Attribute with MergeableMixin, EqualityMixin {
1010
// Used as the key to determine how
1111
// attributes get merged
1212
Object get mergeKey => runtimeType;
13-
1413
@override
1514
Attribute merge(covariant Attribute? other);
1615
}

packages/mix/lib/src/core/attributes_map.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ class AttributeMap<T extends Attribute> {
6060
}
6161

6262
Map<Object, T> toMap() => _map?.cast() ?? {};
63-
6463
@override
6564
bool operator ==(Object other) {
6665
if (identical(this, other)) return true;

packages/mix/lib/src/core/directive.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class TextDirectiveDto extends Dto<TextDirective> {
1212

1313
@visibleForTesting
1414
int get length => _modifiers.length;
15-
1615
@override
1716
TextDirective resolve(MixData mix) {
1817
return TextDirective((String content) {

0 commit comments

Comments
 (0)