From 058708c2c094930553a3e5e5dc91b73d59053911 Mon Sep 17 00:00:00 2001 From: Vulpovile Date: Sat, 11 Jan 2025 15:45:49 -0800 Subject: [PATCH] Better Formatting --- indentcheck.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indentcheck.sh b/indentcheck.sh index 0b958c3..c6a2fac 100755 --- a/indentcheck.sh +++ b/indentcheck.sh @@ -1,6 +1,6 @@ #!/bin/bash # Save the results of the find command into a variable -FILETYPES="css|json|js|java|py|ps1|cs|cmd|bat|htm|html|cpp|c|h|hpp" +FILETYPES="css|json|js|java|py|ps1|cs|cmd|bat|htm|html|cpp|c|h|hpp|sh|bash" FILES=$(find . -regextype awk -regex ".*\.($FILETYPES)" -type f) # Initialize the PROBLEMS variable PROBLEMS="" @@ -10,13 +10,13 @@ for file in $FILES; do # Check for lines with spaces GREP_RESULT=$(grep -nrP '^[ ]+' "$file") if [ -n "$GREP_RESULT" ]; then - PROBLEMS="${PROBLEMS}File $file:$GREP_RESULT"$'\n' # Append the result to PROBLEMS + 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}File $file:$GREP_RESULT"$'\n' # Append the result to PROBLEMS + PROBLEMS="${PROBLEMS}Mixed indentation in file $file:"$'\n'"$GREP_RESULT"$'\n\n\n' # Append the result to PROBLEMS fi done