Skip to content

Commit

Permalink
fix: commit checks updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Riddhiagrawal001 committed Dec 6, 2023
1 parent 92a2d12 commit 0f2d953
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ commit_msg=$(cat "$commit_msg_file")
echo
echo "*****~~~~~ Formatting - Check for unformatted files ~~~~~~*****"

# Check for unformatted JavaScript, TypeScript, and JSON files using Prettier
unformatted_js_files=$(git ls-files | grep '\.js\|\.jsx\|\.ts\|\.tsx\|\.json' | xargs npx prettier --list-different)
# 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
Expand All @@ -26,14 +26,6 @@ echo
echo "*****~~~~~ All files are formatted. ~~~~~~*****"
echo

# JS Code Check
echo "*****~~~~~ Checking ReScript Code ~~~~~~*****"
if (! npm run re:build)
then
echo "*****~~~~~ ReScript Code Compilation Failed! ~~~~~*****"
exit 1
fi

echo
echo "*****~~~~~ Commit message validation! ~~~~~*****"
echo
Expand Down

0 comments on commit 0f2d953

Please sign in to comment.