-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
337 changed files
with
4,000 additions
and
12,259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,47 @@ | ||
#!/bin/sh | ||
|
||
echo "~~~~**** Commit hook started ****~~~~" | ||
echo "*****~~~~~ Commit hook initiated ~~~~~~*****" | ||
|
||
commit_msg_file=$1 | ||
commit_msg=$(cat "$commit_msg_file") | ||
|
||
|
||
# For formatting your code | ||
npx prettier --write . | ||
echo | ||
echo "*****~~~~~ Formatting - Check for unformatted files ~~~~~~*****" | ||
|
||
# Check for unformatted JavaScript and JSON files using Prettier | ||
unformatted_js_files=$(git ls-files | grep '\.js\|\.json' | xargs npx prettier --list-different) | ||
|
||
# If there are unformatted JavaScript, TypeScript, or JSON files, print an error message and exit with a non-zero status code | ||
if [ -n "$unformatted_js_files" ]; then | ||
echo "Error: Unformatted JavaScript, YML or JSON files found. Please run 'npx prettier --write .' for formatting whole repository or 'npx prettier --write' on the following files:" | ||
echo "$unformatted_js_files" | ||
exit 1 | ||
fi | ||
|
||
# Check for unformatted ReScript files | ||
npm run re:format | ||
|
||
# Define your commit message convention (e.g., starts with "feature:", "fix:", etc.) | ||
commit_regex="^(Merge branch|feat|fix|chore|docs|style|refactor|test|enhancement).+" | ||
echo | ||
echo "*****~~~~~ All files are formatted. ~~~~~~*****" | ||
echo | ||
|
||
echo | ||
echo "*****~~~~~ Commit message validation! ~~~~~*****" | ||
echo | ||
# Define your commit message convention (e.g., starts with "feat:", "fix:", etc.) | ||
commit_regex="^(Merge branch|(feat|fix|chore|refactor|docs|test|style|enhancement):).+" | ||
|
||
|
||
|
||
if ! echo "$commit_msg" | grep -Ei "$commit_regex" ; then | ||
echo "Aborting commit. Your commit message does not follow the conventional format." | ||
echo "Example - <feat>: <subject> - <description>" | ||
echo "The commit message should begin with one of the following keywords followed by a colon: 'feat', 'fix', 'chore', 'refactor', 'docs', 'test' or 'style'. For example, it should be formatted like this: 'feat: <subject> - <description>'" | ||
exit 1 | ||
fi | ||
|
||
# If the commit message matches the convention, the script exits successfully. | ||
echo "~~~~**** Commit hook completed ****~~~~" | ||
echo | ||
echo "*****~~~~~ Commit hook completed ~~~~~~*****" | ||
echo | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: CI | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
|
||
jobs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
name: PR Title Spell Check | ||
|
||
on: | ||
merge_group: | ||
pull_request: | ||
types: | ||
- opened | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,3 @@ yarn.lock | |
user_data.sh | ||
*.pem | ||
.bsb.lock | ||
CHANGELOG.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CHANGELOG.md | ||
*euclid* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.