@digitoimistodude/code-quality-checks 2.1.5 → 2.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.husky/commit-msg +4 -5
- package/.husky/pre-commit +11 -4
- package/package.json +1 -1
package/.husky/commit-msg
CHANGED
|
@@ -99,11 +99,10 @@ if [ -f "$commit_msg_file" ]; then
|
|
|
99
99
|
# Check for uncommitted files
|
|
100
100
|
uncommitted_files=$(git status --porcelain | wc -l | tr -d ' ')
|
|
101
101
|
if [ "$uncommitted_files" -gt 0 ]; then
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
fi
|
|
102
|
+
local msg="• You have $uncommitted_files uncommitted files"
|
|
103
|
+
local msg_len=${#msg}
|
|
104
|
+
local padding=$((57 - msg_len))
|
|
105
|
+
echo "${GREEN}║${NC} ${GREEN}${msg}${NC}$(printf '%*s' $padding '')${GREEN}║${NC}"
|
|
107
106
|
fi
|
|
108
107
|
|
|
109
108
|
# Check current branch
|
package/.husky/pre-commit
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
# Pre commit hooks for Dude projects
|
|
2
2
|
# Ref: DEV-177, DEV-373, DEV-623
|
|
3
3
|
|
|
4
|
-
# Version:
|
|
5
|
-
|
|
4
|
+
# Version: dynamically read from CHANGELOG.md
|
|
5
|
+
if [ -f "CHANGELOG.md" ]; then
|
|
6
|
+
CHANGELOG_LINE=$(head -n 1 CHANGELOG.md)
|
|
7
|
+
VERSION_NUM=$(echo "$CHANGELOG_LINE" | sed 's/### //' | sed 's/:.*//')
|
|
8
|
+
VERSION_DATE=$(echo "$CHANGELOG_LINE" | sed 's/.*: //')
|
|
9
|
+
VERSION="$VERSION_NUM ($VERSION_DATE)"
|
|
10
|
+
else
|
|
11
|
+
VERSION="unknown"
|
|
12
|
+
fi
|
|
6
13
|
|
|
7
14
|
# Load configuration
|
|
8
15
|
# First check for local project config, then fall back to package default
|
|
@@ -740,7 +747,7 @@ if [ -n "$scss_files" ]; then
|
|
|
740
747
|
original_dir=$(pwd)
|
|
741
748
|
cd "$theme_dir_for_stylelint" || exit 1
|
|
742
749
|
|
|
743
|
-
if ! $stylelint_cmd --config "$stylelint_config" $relative_scss_files 2>/dev/null; then
|
|
750
|
+
if ! $stylelint_cmd --config "$stylelint_config" --max-warnings 0 $relative_scss_files 2>/dev/null; then
|
|
744
751
|
cd "$original_dir" || exit 1
|
|
745
752
|
echo "${RED}${CROSS} FAILED${NC}"
|
|
746
753
|
echo " ${RED}Stylelint found errors in SCSS files${NC}"
|
|
@@ -760,7 +767,7 @@ if [ -n "$scss_files" ]; then
|
|
|
760
767
|
fi
|
|
761
768
|
else
|
|
762
769
|
# Standalone: run from current directory
|
|
763
|
-
if ! $stylelint_cmd --config "$stylelint_config" $scss_files 2>/dev/null; then
|
|
770
|
+
if ! $stylelint_cmd --config "$stylelint_config" --max-warnings 0 $scss_files 2>/dev/null; then
|
|
764
771
|
echo "${RED}${CROSS} FAILED${NC}"
|
|
765
772
|
echo " ${RED}Stylelint found errors in SCSS files${NC}"
|
|
766
773
|
echo " ${YELLOW}Please fix the following files:${NC}"
|