File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ NLOC_LIMIT=250
2424FILES=$( git diff --cached --name-only --diff-filter=ACM | grep -E ' \.tsx$|\.ts$' )
2525
2626# Check if there are any files to analyze
27- if [[ -z " $FILES " ] ]; then
27+ if [ -z " $FILES " ]; then
2828 echo " No Typescript files to check"
2929 exit 0 # No files to check, allow commit
3030fi
@@ -40,13 +40,13 @@ for FILE in $FILES; do
4040 OUTPUT=$( lizard -C $COMPLEXITY_LIMIT -Tnloc=$NLOC_LIMIT -w --warning-msvs " $FILE " )
4141 ERROR_CODE=$?
4242
43- if [[ " $ERROR_CODE " -ne 0 ] ]; then
43+ if [ " $ERROR_CODE " -ne 0 ]; then
4444 ERROR_LIST+=" $OUTPUT \n"
4545 fi
4646done
4747
4848# Check if there were any errors
49- if [[ -n " $ERROR_LIST " ] ]; then
49+ if [ -n " $ERROR_LIST " ]; then
5050 echo " ❌ Commit aborted due to the errors in the following files:"
5151 echo " $ERROR_LIST "
5252 echo " Limits are: Code Complexity (CCN)=$COMPLEXITY_LIMIT and Number of Lines (NLOC)=$NLOC_LIMIT "
You can’t perform that action at this time.
0 commit comments