-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git Hook Manager & Runner: husky #20
Merged
Merged
+115
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In GH-17 lint-staged [1] was added, a Git Hook [2] run linters against staged files before each commit. To automatically run this and other hooks that might be added later on, the hook manager and runner husky [3] is used. Like the already added tools Prettier [4], remark-lint [5] and lint-staged [6] it is (unfortunately) also written in JavaScript again Since NodeJS [7] is therefore already a development dependency it doesn't really matter that husky is another NPM package too. Unlike these previous tools there are indeed alternatives written in Go [8] like lefthook [9] or quickhook [10], but it requires time to test and evaluate them before actually replacing husky. Also a long as there are no comparable alternatives to the already used tools listed above, this template would be more complex by requiring both Node and Go as development dependency. Therefore husky takes over the part as hook manager & runner since it is a stable, production-proven and advanced project that I already use in almost any other project setup. >>> Configuration The `.huskyrc.js` configuration file is placed in the project root and includes the command to run for any supported Git hook [11]. Initially it contains entries for the following hooks: - `pre-commit` - Runs lint-staged (GH-17) before each commit to ensure all staged files are compliant to all style guides. [1]: https://github.com/okonet/lint-staged [2]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks [3]: https://github.com/typicode/husky [4]: #13 [5]: #15 [6]: #17 [7]: https://nodejs.org [8]: https://go.dev [9]: https://github.com/Arkweid/lefthook [10]: https://github.com/dirk/quickhook [11]: https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks GH-19
svengreb
added a commit
that referenced
this pull request
Aug 22, 2020
In GH-17 lint-staged [1] was added, a Git Hook [2] run linters against staged files before each commit. To automatically run this and other hooks that might be added later on, the hook manager and runner husky [3] is used. Like the already added tools Prettier [4], remark-lint [5] and lint-staged [6] it is (unfortunately) also written in JavaScript again Since NodeJS [7] is therefore already a development dependency it doesn't really matter that husky is another NPM package too. Unlike these previous tools there are indeed alternatives written in Go [8] like lefthook [9] or quickhook [10], but it requires time to test and evaluate them before actually replacing husky. Also a long as there are no comparable alternatives to the already used tools listed above, this template would be more complex by requiring both Node and Go as development dependency. Therefore husky takes over the part as hook manager & runner since it is a stable, production-proven and advanced project that I already use in almost any other project setup. >>> Configuration The `.huskyrc.js` configuration file is placed in the project root and includes the command to run for any supported Git hook [11]. Initially it contains entries for the following hooks: - `pre-commit` - Runs lint-staged (GH-17) before each commit to ensure all staged files are compliant to all style guides. [1]: https://github.com/okonet/lint-staged [2]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks [3]: https://github.com/typicode/husky [4]: #13 [5]: #15 [6]: #17 [7]: https://nodejs.org [8]: https://go.dev [9]: https://github.com/Arkweid/lefthook [10]: https://github.com/dirk/quickhook [11]: https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks Resolves GH-19
svengreb
added a commit
that referenced
this pull request
Aug 22, 2020
In GH-17 lint-staged [1] was added, a Git Hook [2] run linters against staged files before each commit. To automatically run this and other hooks that might be added later on, the hook manager and runner husky [3] is used. Like the already added tools Prettier [4], remark-lint [5] and lint-staged [6] it is (unfortunately) also written in JavaScript again Since NodeJS [7] is therefore already a development dependency it doesn't really matter that husky is another NPM package too. Unlike these previous tools there are indeed alternatives written in Go [8] like lefthook [9] or quickhook [10], but it requires time to test and evaluate them before actually replacing husky. Also a long as there are no comparable alternatives to the already used tools listed above, this template would be more complex by requiring both Node and Go as development dependency. Therefore husky takes over the part as hook manager & runner since it is a stable, production-proven and advanced project that I already use in almost any other project setup. >>> Configuration The `.huskyrc.js` configuration file is placed in the project root and includes the command to run for any supported Git hook [11]. Initially it contains entries for the following hooks: - `pre-commit` - Runs lint-staged (GH-17) before each commit to ensure all staged files are compliant to all style guides. [1]: https://github.com/okonet/lint-staged [2]: https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks [3]: https://github.com/typicode/husky [4]: #13 [5]: #15 [6]: #17 [7]: https://nodejs.org [8]: https://go.dev [9]: https://github.com/Arkweid/lefthook [10]: https://github.com/dirk/quickhook [11]: https://github.com/typicode/husky/blob/master/DOCS.md#supported-hooks Resolves GH-19
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #19