|
@@ -31,11 +31,14 @@ for FILE in `git diff --cached --name-only` ; do
|
|
|
echo -e "[ERROR] $FILE: Found pdb.set_trace() debug statements in file.\n"
|
|
echo -e "[ERROR] $FILE: Found pdb.set_trace() debug statements in file.\n"
|
|
|
fi
|
|
fi
|
|
|
elif [[ "$FILE" =~ ^.+(js|jsx|ts|tsx)$ ]]; then
|
|
elif [[ "$FILE" =~ ^.+(js|jsx|ts|tsx)$ ]]; then
|
|
|
|
|
+ FOLDERS_PATTERN="^(desktop/core/src/desktop/js|tools/sql-docs|tools/jison)/"
|
|
|
echo "Running ESLint for $FILE..."
|
|
echo "Running ESLint for $FILE..."
|
|
|
- eslint "$FILE" # Run ESLint for JavaScript/JSX files
|
|
|
|
|
- if [ $? -ne 0 ]; then
|
|
|
|
|
- ERRORS=true
|
|
|
|
|
- echo -e "[ERROR] ESLint found issues in $FILE.\n"
|
|
|
|
|
|
|
+ if [[ "$FILE" =~ $FOLDERS_PATTERN ]]; then # Check if file is inside one of the desired folders
|
|
|
|
|
+ eslint "$FILE" # Run ESLint for JavaScript/JSX files
|
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
|
+ ERRORS=true
|
|
|
|
|
+ echo -e "[ERROR] ESLint found issues in $FILE.\n"
|
|
|
|
|
+ fi
|
|
|
fi
|
|
fi
|
|
|
fi
|
|
fi
|
|
|
done
|
|
done
|