unity-builder icon indicating copy to clipboard operation
unity-builder copied to clipboard

Breaking linting setup

Open webbertakken opened this issue 2 years ago • 2 comments

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:

  1. we only lint staged files on pre-commit (i.e. using lint staged) to minimize work inside pre-commit hook
  2. it should work on Linux, MacOS and Windows
  3. a fresh clone should require no additional steps other than running yarn and having IDE plugins installed
  4. no new tracked files should be generated right after cloning or running yarn.

webbertakken avatar Mar 13 '22 14:03 webbertakken

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?

davidmfinol avatar Apr 22 '22 23:04 davidmfinol

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",

webbertakken avatar Apr 23 '22 09:04 webbertakken