Skip to content

workflow: switch to simple-git-hooks#6219

Merged
patak-cat merged 1 commit intovitejs:mainfrom
jeffydc:chore/husky
Jan 5, 2022
Merged

workflow: switch to simple-git-hooks#6219
patak-cat merged 1 commit intovitejs:mainfrom
jeffydc:chore/husky

Conversation

@jeffydc
Copy link
Contributor

@jeffydc jeffydc commented Dec 21, 2021

Description

Switch yorkie to husky in the cost of having .husky directory.

Switch to https://github.com/toplenboren/simple-git-hooks due to the minimal diff and not to have one more directory for git hooks.

Past discussion: #5869 (comment)

Additional context

yorkie is not working on my machine and saw others are also having this issue.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@jeffydc jeffydc requested a review from haoqunjiang December 22, 2021 11:07
haoqunjiang
haoqunjiang previously approved these changes Dec 23, 2021
Shinigami92
Shinigami92 previously approved these changes Dec 24, 2021
@TrySound
Copy link
Contributor

There is also small https://github.com/toplenboren/simple-git-hooks. It was created when husky messed with license.
I'm out of context about previous problems with prev solutions. But simple-git-hooks does not require .husky folder.

@Shinigami92
Copy link
Member

Would these husky files also work for windows users without wsl?

@jeffydc
Copy link
Contributor Author

jeffydc commented Dec 25, 2021

As per docs, it should work. It said it supports Windows. https://typicode.github.io/husky/#/

Can someone who has Windows machine can try this PR?

Thanks.

@antfu
Copy link
Member

antfu commented Dec 27, 2021

I would also prefer to simple-git-hooks personally

@jeffydc
Copy link
Contributor Author

jeffydc commented Dec 28, 2021

Just found out SvelteKit approach. SvelteKit uses the normal git hooks features and point the git hooks directory to .githooks.

In husky, husky wraps that process with JS.

In simple-git-hooks, simple-git-hooks overwrite the hooks script files in .git/hooks directory with scripts from simple-git-hooks object from package.json.

So, when updating the hook script,

  • normal git features and husky don't need to update the hook script.
  • simple-git-hooks need to rerun npx simple-git-hooks.

So, which one do you want to proceed with?

@benmccann
Copy link
Collaborator

I think SvelteKit may have copied it from vite-plugin-svelte originally setup by @dominikg

FYI, this PR will need a rebase

@jeffydc jeffydc changed the title workflow: switch to husky workflow: switch to simple-git-hooks Jan 3, 2022
@jeffydc jeffydc requested a review from Shinigami92 January 3, 2022 17:36
Copy link
Member

@Shinigami92 Shinigami92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assume you tested it, this is MUCH better 🙂

@Shinigami92 Shinigami92 added enhancement New feature or request and removed needs rebase labels Jan 3, 2022
@jeffydc
Copy link
Contributor Author

jeffydc commented Jan 4, 2022

Assume you tested it, this is MUCH better 🙂

Yes, git hooks run when I push.

@patak-cat patak-cat merged commit eb9b374 into vitejs:main Jan 5, 2022
patak-cat pushed a commit that referenced this pull request Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants