You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 16, 2025. It is now read-only.
Description:
Implement pre-commit and pre-push hooks to automate running Tailwind CSS compilation, build scripts, RuboCop for linting, and tests to ensure code quality before committing or pushing changes to GitHub.
Motivation:
By implementing these hooks, we can ensure that essential tasks are automated and executed before code is committed or pushed, maintaining code quality and preventing broken builds.
Tasks:
Install Husky for managing Git hooks.
Create a pre-commit hook to run the following tasks:
Description:
Implement pre-commit and pre-push hooks to automate running Tailwind CSS compilation, build scripts, RuboCop for linting, and tests to ensure code quality before committing or pushing changes to GitHub.
Motivation:
By implementing these hooks, we can ensure that essential tasks are automated and executed before code is committed or pushed, maintaining code quality and preventing broken builds.
Tasks:
Install Husky for managing Git hooks.
Create a pre-commit hook to run the following tasks:
Compile Tailwind CSS:
npx tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.cssRun the build script:
node build.ci.jsRun RuboCop for linting:
bundle exec rubocopRun tests:
bundle exec rspecCreate a pre-push hook to run the same tasks as the pre-commit hook.
Update package.json to include Husky configuration.
Ensure hooks check for uncommitted changes and prompt the user to commit them before proceeding.
Example package.json Scripts: