game-ci / unity-builder

Build Unity projects for different platforms
https://github.com/marketplace/actions/unity-builder
MIT License
838 stars 239 forks source link

Breaking linting setup #356

Open webbertakken opened 2 years ago

webbertakken commented 2 years ago

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

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.
davidmfinol commented 2 years ago

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?

webbertakken commented 2 years ago

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