Skip to content

Commit

Permalink
Disable husky git hooks by default, opt-in using npx husky (#1472)
Browse files Browse the repository at this point in the history
* Disable husky by default, opt-in using `npx husky`

* Update ToC

* Make it clear unit tests don't run in pre-commit hook

* brain fart
  • Loading branch information
rhyskoedijk authored Nov 19, 2024
1 parent 7ea2955 commit 0e5bed9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 10 additions & 0 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Thank you for contributing to the Dependabot for Azure DevOps project.
- [Static code analyzers and linters](#static-code-analyzers-and-linters)
- [Formatters](#formatters)
- [Spelling](#spelling)
- [Automatically run quality checks on commit](#automatically-run-quality-checks-on-commit)

# Contribution workflow

Expand Down Expand Up @@ -61,3 +62,12 @@ pip install codespell
codespell # to check for misspellings
codespell --write-changes # to automatically fix misspellings
```

## Automatically run quality checks on commit

If you'd like spelling, formatting, and linting checks to be run automatically on commit, enable the [Husky](https://typicode.github.io/husky/how-to.html) git hooks using:
```bash
npx husky
```

When enabled, your local commits will be rejected if any of the quality checks fail; Unit tests are **not** run due to their long execution time, you must still run them manually.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"version": "0.0.0",
"private": true,
"scripts": {
"prepare": "husky",
"postinstall": "npm --prefix extension install",
"format": "prettier --write .",
"format:check": "prettier --check ."
Expand Down

0 comments on commit 0e5bed9

Please sign in to comment.