Currently we have pre-commit and pre-push hooks that detect formatting errors in all files checked into the repo.
One problem is that, if you don't have husky installed and set up these commit hooks won't run and formatting errors may slip into the codebase.
To prevent these errors from reaching the main branch, we should also run npm run validate in CI.
Expected outcome
All formatting errors in js code, config files, scripts and markdown files should be detected by our CI pipeline before merging to main.
Context
While reviewing this MR submitted to this repository by a contributor who had set up husky, we noticed that husky automatically fixed some formatting errors it detected in unrelated files (CONTRIBUTING.MD). This signaled to us that formatting errors have accidentally been merged to main previously.
Overview
Currently we have pre-commit and pre-push hooks that detect formatting errors in all files checked into the repo.
One problem is that, if you don't have husky installed and set up these commit hooks won't run and formatting errors may slip into the codebase.
To prevent these errors from reaching the
main
branch, we should also runnpm run validate
in CI.Expected outcome
All formatting errors in js code, config files, scripts and markdown files should be detected by our CI pipeline before merging to main.
Context
While reviewing this MR submitted to this repository by a contributor who had set up husky, we noticed that husky automatically fixed some formatting errors it detected in unrelated files (CONTRIBUTING.MD). This signaled to us that formatting errors have accidentally been merged to
main
previously.