Skip to content

Commit 067210d

Browse files
committed
Add code style checking before commits
1 parent 89d4ac7 commit 067210d

File tree

3 files changed

+263
-71
lines changed

3 files changed

+263
-71
lines changed

bin/check-code-style.sh

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
RED='\033[0;31m'
4+
BLUE='\033[0;34m'
5+
NC='\033[0m' # No Color
6+
7+
echo "Checking code style..."
8+
npm run prettier-check
9+
10+
rc=$?;
11+
if [[ $rc != 0 ]]
12+
then
13+
echo ""
14+
echo -e "${RED}Code style checking was not successful.${NC}"
15+
echo -e "Run '${BLUE}npm run format${NC}' and add the changes to git to fix the problem."
16+
fi
17+
exit $rc

0 commit comments

Comments
 (0)