Repository navigation
Set up husky.net - #2175
Merged
Merged
Set up husky.net#2175
Conversation
Mpdreamz
reviewed
Nov 7, 2025
Mpdreamz
approved these changes
Nov 7, 2025
Mpdreamz
left a comment
Member
There was a problem hiding this comment.
LGTM thank you for setting this up.
reakaleek
marked this pull request as draft
November 7, 2025 09:02
reakaleek
force-pushed
the
feature/husky
branch
3 times, most recently
from
November 7, 2025 10:41
f386295 to
f1796bd
Compare
Contributor
🔍 Preview links for changed docs |
reakaleek
force-pushed
the
feature/husky
branch
from
November 7, 2025 10:51
f1796bd to
a80d9e8
Compare
reakaleek
force-pushed
the
feature/husky
branch
from
November 7, 2025 10:57
a80d9e8 to
f79793d
Compare
reakaleek
marked this pull request as ready for review
November 7, 2025 10:57
Mpdreamz
approved these changes
Nov 7, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Details
What Gets Checked
Pre-commit hooks (run on staged files):
src/Elastic.Documentation.Site/tsc --noEmit(only if TS files are staged)Pre-push hooks (run on files being pushed):
./build.sh lint(runsdotnet format --verify-no-changes)Installation
Husky.Net is included as a dotnet tool. After cloning the repository, restore the tools:
Then install the git hooks:
That's it! The hooks will now run automatically on every commit and push.
Usage
Once installed, hooks run automatically when you commit or push:
Note: If hooks modify files (prettier, eslint), the commit will fail so you can review the changes. Simply stage the changes and commit again:
git add -u git commit -m "your message"If the dotnet-lint hook fails during push, you need to fix the linting errors and commit the fixes before pushing again.
Manual Execution
You can test hooks without committing or pushing:
Configuration
Hook configuration is defined in
.husky/task-runner.json. See the Husky.Net documentation for more details.