From 0b98204e4a6764a05e3fa60b716984607f763281 Mon Sep 17 00:00:00 2001 From: jld3103 Date: Fri, 14 Jul 2023 08:41:26 +0200 Subject: [PATCH] feat(tool): Add husky for git hooks --- .husky/commit-msg | 5 +++++ pubspec.yaml | 1 + tool/setup.sh | 1 + 3 files changed, 7 insertions(+) create mode 100755 .husky/commit-msg diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100755 index 00000000..0f679104 --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1,5 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +# https://github.com/hyiso/commitlint/issues/6 +sed "s/^fixup! //" < "$1" | dart run commitlint_cli diff --git a/pubspec.yaml b/pubspec.yaml index cb4afeff..0d88afb6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -6,4 +6,5 @@ environment: dev_dependencies: commitlint_cli: ^0.4.1 fvm: ^2.4.1 + husky: ^0.1.6 melos: ^3.1.0 diff --git a/tool/setup.sh b/tool/setup.sh index c092d266..f92e2636 100755 --- a/tool/setup.sh +++ b/tool/setup.sh @@ -6,3 +6,4 @@ dart pub global activate melos 3.1.0 dart pub global activate fvm 2.4.1 echo "y" | fvm install melos exec --concurrency=1 flutter pub get +dart run husky install