From 0e5bed9fe8f768aae05b380423702c938bda642c Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Tue, 19 Nov 2024 22:08:33 +1300 Subject: [PATCH] Disable husky git hooks by default, opt-in using `npx husky` (#1472) * 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 --- CONTRIBUTING.MD | 10 ++++++++++ package.json | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index fc09cc62..cc3fe562 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -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 @@ -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. diff --git a/package.json b/package.json index c81cd6ba..9adb3da3 100644 --- a/package.json +++ b/package.json @@ -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 ."