From 462ad89d31050a20b40fce485c6a1d173e6e0f80 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Tue, 19 Nov 2024 21:46:11 +1300 Subject: [PATCH 1/4] Disable husky by default, opt-in using `npx husky` --- CONTRIBUTING.MD | 4 ++++ package.json | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index fc09cc62..c00ad618 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -61,3 +61,7 @@ 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 `npx husky`; When enabled, your local commits will be rejected if any of the quality checks fail. 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 ." From 48d27971e9e3b79100bdb72a16df5015de5d8525 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Tue, 19 Nov 2024 21:48:42 +1300 Subject: [PATCH 2/4] Update ToC --- CONTRIBUTING.MD | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index c00ad618..3be57cff 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 From 44f10eb22114b892c5e552733b8e599218a6cbc0 Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Tue, 19 Nov 2024 21:54:30 +1300 Subject: [PATCH 3/4] Make it clear unit tests don't run in pre-commit hook --- CONTRIBUTING.MD | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index 3be57cff..b7ac308e 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -65,4 +65,9 @@ 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 `npx husky`; When enabled, your local commits will be rejected if any of the quality checks fail. +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 them manually. From 23a1c84456620a3c648b93c34d853daf406b77cd Mon Sep 17 00:00:00 2001 From: Rhys Koedijk Date: Tue, 19 Nov 2024 21:57:58 +1300 Subject: [PATCH 4/4] brain fart --- CONTRIBUTING.MD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.MD b/CONTRIBUTING.MD index b7ac308e..cc3fe562 100644 --- a/CONTRIBUTING.MD +++ b/CONTRIBUTING.MD @@ -70,4 +70,4 @@ If you'd like spelling, formatting, and linting checks to be run automatically o 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 them manually. +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.