diff --git a/.githooks/pre-commit b/.githooks/pre-commit new file mode 100755 index 0000000..24051f2 --- /dev/null +++ b/.githooks/pre-commit @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +#ignore merges +isMerge=$(git rev-parse -q --verify MERGE_HEAD) +if [ -n "$isMerge" ]; then + exit +fi + +# fix with linter +dart fix --apply + +# Regexp for grep to only choose some file extensions for formatting +exts="\.\(dart\)$" +echo "Pre-commit: formatting changed files" +# Format staged files +for file in $(git diff --cached --name-only --diff-filter=ACMR | grep $exts); do + echo "Formatting $file" + dart format --line-length=120 $file + git add $file +done \ No newline at end of file diff --git a/.githooks/pre-push b/.githooks/pre-push new file mode 100755 index 0000000..91a5190 --- /dev/null +++ b/.githooks/pre-push @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +printf "\e[33;1m%s\e[0m\n" 'Running the Flutter analyzer' +flutter analyze +if [ $? -ne 0 ]; then + printf "\e[31;1m%s\e[0m\n" 'Flutter analyzer error' + exit 1 +fi +printf "\e[33;1m%s\e[0m\n" 'Finished running the Flutter analyzer' + +printf "\e[33;1m%s\e[0m\n" 'Running unit tests' +flutter test +if [ $? -ne 0 ]; then + printf "\e[31;1m%s\e[0m\n" 'Unit tests error' + exit 1 +fi +printf "\e[33;1m%s\e[0m\n" 'Finished running unit tests' \ No newline at end of file diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..b60d7cf --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ +## Description + + +## How Has This Been Tested? + + +## Screenshots + + +## Type of Change + + + +- [ ] โœจ New feature (non-breaking change which adds functionality) +- [ ] ๐Ÿ› ๏ธ Bug fix (non-breaking change which fixes an issue) +- [ ] โŒ Breaking change (fix or feature that would cause existing functionality to change) +- [ ] ๐Ÿงน Code refactor +- [ ] ๐Ÿ—‘๏ธ Chore