unity-builder
unity-builder copied to clipboard
Breaking linting setup
Just installed unity-builder repo on a new pc. I found that it's installing 4 additional hooks and tests are running both through lint staged (only the relevant ones) and as part of the git hook (all of them).
Subsequently
- Lint-staged no longer fails
- The catch all test that's now in the pre-commit hook has a bunch of tests that ended up failing (on windows) too
- The time to run pre-commit is now way beyond a few seconds, which breaks developer flow.
Result: It looks like the repository is currently not very developer friendly.
I'm happy with the upgrades to the latest husky and lint-staged on all repos but now we have to make sure that:
- we only lint staged files on pre-commit (i.e. using lint staged) to minimize work inside pre-commit hook
- it should work on Linux, MacOS and Windows
- a fresh clone should require no additional steps other than running
yarnand having IDE plugins installed - no new tracked files should be generated right after cloning or running yarn.
I think the changes we've made for unity-builder seem to be working well, so is the next step simply to apply the same changes to the other repos?
Yes, but there are a few more things.
One more thing we should also do is upgrade the requirements to node >=16, as it allows for use of fs/promises and resolves some other weird bugs.
The integration test that checks that no package-lock.json exists in the project should probably also be moved, at least to the repos that have jest installed. See https://github.com/game-ci/unity-builder/blob/main/src/integrity.test.ts
Lastly, we should probably trigger a script that uninstalls husky. We have yet to confirm that this script in package.json works:
"prepare": "lefthook install && npx husky uninstall -y",