uni
uni copied to clipboard
Add build_runner to pre-commit-hook
As the number of places where build_runner is used increases, we need a way to always ensure that the generated files in the repository are consistent with the files used to generate them.
This can be done in two main ways:
- Unstage all generated files and add them to the gitignore. In the CI, we would need to run build_runner. When we clone the repository, we would also need to run build_runner.
- Run build_runner in the pre-commit-hook. This ensures that the committed files are in sync, as long as the committer has the pre-commit-hook installed.
I prefer the second approach, and create an action to check if the existing committed generated files are the most updated ones. Fails otherwise