forked from WikiEducationFoundation/WikiEduDashboard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request WikiEducationFoundation#6194 from Formasitchijoh/r…
…uby-linting Chore: Add pre-commit hook for linting checks (Rubocop)
- Loading branch information
Showing
2 changed files
with
27 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
echo "⚡ Pre-commit hook is running..." | ||
|
||
# Run Rubocop with parallel processing | ||
bundle exec rubocop --parallel | ||
|
||
# Check the status of Rubocop | ||
if [ $? -ne 0 ]; then | ||
echo -e "🔴 Linting failed! Please fix the offenses before committing." | ||
echo "You can run 'bundle exec rubocop -a' to auto-correct the issues." | ||
exit 1 | ||
fi | ||
|
||
echo -e "🟢 No linting issues found. Proceeding with commit.\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters