diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index afad02015d..8fe28f8108 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -1,17 +1,15 @@ #!/bin/bash -# Notify that the pre-commit hook is running -echo "Pre-commit hook is running..." +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 "🔴 Linting failed! Please fix the offenses before committing." + 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 -# Notify that there are no linting issues and the commit can proceed -echo "✅ No linting issues found. Proceeding with commit.\n" +echo -e "🟢 No linting issues found. Proceeding with commit.\n" diff --git a/docs/setup.md b/docs/setup.md index eed8430d67..41699f3bb1 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -76,8 +76,11 @@ If you know your way around Rails, here's the very short version. Some additiona 10. **Building assets:** * `yarn start` to built the development version * `yarn build` to generate the production version -11. Finally, start rails with `guard` or `rails s`and open http://localhost:3000 in a web browser. -12. Now, you're up and running!! +11. (Recommended) Configure Git + * `git config core.hooksPath .git-hooks` to recognize the .git-hooks directory as the hooks directory + * `chmod +x .git-hooks/pre-commit` to make the pre-commit hook executable +12. Finally, start rails with `guard` or `rails s`and open http://localhost:3000 in a web browser. +13. Now, you're up and running!! ## Detailed instructions @@ -148,6 +151,13 @@ If you know your way around Rails, here's the very short version. Some additiona - (Optional) Set up a [`post-merge`](https://git-scm.com/docs/githooks#_post_merge) hook to update all dependencies if `package.json` or `Gemfile` changes. - Copy `.git-hooks/pull-update-deps` to `.git/hooks/post-merge` + +- (Recommended) Set up a [`pre-commit`](https://git-scm.com/docs/githooks#_pre-commit) hook to run linting before making a commit + - `git config core.hooksPath .git-hooks` Configure Git to recognize the .git-hooks directory as the hooks directory + - `chmod +x .git-hooks/pre-commit` Make the pre-commit hook executable + + + ## Initialize 1. **Migrate the development and test databases** - $ `rake db:migrate`