fea(githooks): hit pre-commit and commit-msg hooks

This commit is contained in:
dqnid committed 2024-11-03 18:38:28 +01:00
1 parent a474783a02
commit 3cc9799bdc
6 files changed
+765 -11

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
#!/bin/sh
echo -e "\e[35m➤ [COMMIT]\e[0m Checking message\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
# npx commitlint --edit $1
if [[ $? != 0 ]]; then
echo -e "\e[31m➤ [COMMIT]\e[0m Wrong format on message\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
exit -1
fi
echo -e "\e[32m➤ [COMMIT]\e[0m Message ok\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
cd ./front
echo -e "\e[35m➤ [PRETTIER]\e[0m Formatting front files\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
npx prettier . --write --log-level silent
echo -e "\e[35m➤ [ESLINT]\e[0m Checking front code\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
npx lint-staged --silent
echo $?
if [[ $? != 0 ]]; then
echo -e "\e[31m➤ [ESLINT]\e[0m Errors in code\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
exit -1;
fi
echo -e "\e[32m➤ [ESLINT]\e[0m Code ok\e[37m - \e[33m$(date +"%H:%M:%S")\e[0m"
cd ..