Added pre-commit hooks for Rome, Next-Lint, Run Tests, and Build in .pre-commit-config.yaml. The hooks are configured to run on commit and push stages and updated the contribution doc accordingly.
Description
This pull request adds pre-commit hooks to ensure consistent code formatting, linting, building and testing before committing and pushing changes. The following hooks have been added:
Rome: to format the code using Rome
Next-Lint: to run linting for the Next.js project
Run Tests: to run tests using npm run test
Build: to build the Next.js project
These hooks will help to ensure that code quality is maintained and prevent common errors and issues from being introduced.
Usage
To use these pre-commit hooks, ensure that you have pre-commit installed:
pip install pre-commit # other options on https://pre-commit.com/
Then, run the following command in the root directory of your project:
This will install all hooks with the stages field set to either commit or push. The --hook-type option is used to specify commit hooks
After running this command, all hooks in your .pre-commit-config.yaml file will be installed and ready to use. You can then run git commit or git push as usual, and the pre-commit hooks will automatically run before the commit or push is completed.
Closes #18
Changes
Added pre-commit hooks for Rome, Next-Lint, Run Tests, and Build in .pre-commit-config.yaml. The hooks are configured to run on commit and push stages and updated the contribution doc accordingly.
Description
This pull request adds pre-commit hooks to ensure consistent code formatting, linting, building and testing before committing and pushing changes. The following hooks have been added:
Rome: to format the code using Rome Next-Lint: to run linting for the Next.js project Run Tests: to run tests using npm run test Build: to build the Next.js project
These hooks will help to ensure that code quality is maintained and prevent common errors and issues from being introduced.
Usage To use these pre-commit hooks, ensure that you have pre-commit installed:
Then, run the following command in the root directory of your project:
This will install all hooks with the stages field set to either commit or push. The --hook-type option is used to specify commit hooks
After running this command, all hooks in your .pre-commit-config.yaml file will be installed and ready to use. You can then run git commit or git push as usual, and the pre-commit hooks will automatically run before the commit or push is completed.
Example output when committing
Example output when pushing