git hooks

This commit is contained in:
2023-04-30 15:55:44 +03:00
parent f67def6a8d
commit 448fa22705
5 changed files with 84 additions and 3 deletions

23
.githooks/pre-commit Executable file
View File

@@ -0,0 +1,23 @@
#!/bin/sh
# prettier
echo "Checking by Prettier..."
prettier --check . &> /dev/null
if [[ "$?" == 0 ]]; then
echo "✅ Prettier"
else
echo "⛔ Prettier error"
exit 1
fi
# editorconfig
echo "Checking by EditorConfig..."
ec . &> /dev/null
if [[ "$?" == 0 ]]; then
echo "✅ EditorConfig"
else
echo "⛔ EditorConfig error"
exit 1
fi