From accb2a9fc5dd451ed5a4b7f1aece117340c26876 Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Sat, 11 Jan 2025 15:47:18 -0800 Subject: [PATCH] Fix format errors --- indentcheck.sh | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/indentcheck.sh b/indentcheck.sh index c6a2fac..0003ede 100755 --- a/indentcheck.sh +++ b/indentcheck.sh @@ -7,25 +7,25 @@ PROBLEMS="" # Pass the files to grep and sed for file in $FILES; do - # Check for lines with spaces - GREP_RESULT=$(grep -nrP '^[ ]+' "$file") - if [ -n "$GREP_RESULT" ]; then - PROBLEMS="${PROBLEMS}Space indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS - fi + # Check for lines with spaces + GREP_RESULT=$(grep -nrP '^[ ]+' "$file") + if [ -n "$GREP_RESULT" ]; then + PROBLEMS="${PROBLEMS}Space indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS + fi - # Check for lines with mixed tabs and spaces - GREP_RESULT=$(grep -nrP '^\t+ +' "$file") - if [ -n "$GREP_RESULT" ]; then - PROBLEMS="${PROBLEMS}Mixed indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS - fi + # Check for lines with mixed tabs and spaces + GREP_RESULT=$(grep -nrP '^\t+ +' "$file") + if [ -n "$GREP_RESULT" ]; then + PROBLEMS="${PROBLEMS}Mixed indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS + fi done # Check if there were any problems if [ -n "$PROBLEMS" ]; then - echo "Indentation issues detected. Please fix the above lines." - echo "$PROBLEMS" - exit 1 + echo "Indentation issues detected. Please fix the above lines." + echo "$PROBLEMS" + exit 1 else - echo "No indentation issues detected." - exit 0 + echo "No indentation issues detected." + exit 0 fi