diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 34ee5d0f8..93a3fd083 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -24,7 +24,6 @@ jobs: - lockfile - manifest - md - - sh - yml steps: - name: Checkout repository diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9fa0bb532..2374254aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -115,10 +115,8 @@ If you decide to make a contribution, please do use the following workflow: ### Getting Started Before you start making changes you should run `npm install`. This ensures your -local development environment is set up and ready to go. Run `npm run setup` -afterwards if you want to enable git hooks that automatically validate your -changes. Next, consider running `npm run verify` to make sure you're ready to -get started. +local development environment is set up and ready to go. Next, consider running +`npm run verify` to make sure you're ready to get started. If these steps do not _just work_, please [open an issue] and share your experience. This way, we can improve the experience for future contributors. @@ -152,7 +150,6 @@ your changes if applicable: | `package-lock.json` | `npm run check:lockfile` | | `package.json` | `npm run check:manifest` | | MarkDown | `npm run check:md` | -| Shell scripts | `npm run check:sh` | | YAML | `npm run check:yml` | #### Typings diff --git a/package-lock.json b/package-lock.json index ad7167a6e..cca92cf5d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,6 @@ "eslint-plugin-unicorn": "62.0.0", "eslint-plugin-yml": "3.3.0", "fast-check": "4.6.0", - "husky": "9.1.1", "licensee": "12.0.1", "lockfile-lint": "5.0.0", "ls-engines": "0.10.0", @@ -7446,22 +7445,6 @@ "node": ">=18.18.0" } }, - "node_modules/husky": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.1.tgz", - "integrity": "sha512-fCqlqLXcBnXa/TJXmT93/A36tJsjdJkibQ1MuIiFyCCYUlpYpIaj2mv1w+3KR6Rzu1IC3slFTje5f6DUp2A2rg==", - "dev": true, - "license": "MIT", - "bin": { - "husky": "bin.js" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/typicode" - } - }, "node_modules/iconv-lite": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", diff --git a/package.json b/package.json index 01c80c53e..8bbff2518 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,6 @@ "eslint-plugin-unicorn": "62.0.0", "eslint-plugin-yml": "3.3.0", "fast-check": "4.6.0", - "husky": "9.1.1", "licensee": "12.0.1", "lockfile-lint": "5.0.0", "ls-engines": "0.10.0", @@ -120,7 +119,6 @@ "check:md": "npm-run-all check:md:*", "check:md:code": "npm run _eslint -- '**/*.md'", "check:md:text": "markdownlint --config config/markdownlint.yml --dot --ignore-path .gitignore .", - "check:sh": "node script/maybe-run.js shellcheck script/hooks/*.sh script/hooks/pre-*", "check:yml": "npm run _eslint -- '**/*.yml'", "clean": "node script/clean.js", "coverage": "npm-run-all coverage:*", @@ -140,7 +138,6 @@ "mutation": "npm-run-all mutation:*", "mutation:unit": "stryker run config/stryker/unit.js", "mutation:integration": "npm run transpile && stryker run config/stryker/integration.js", - "setup": "husky script/hooks", "test": "npm-run-all test:*", "test:unit": "ava test/unit/**/*.test.js", "test:integration": "npm run transpile && ava test/integration/**/*.test.js --timeout 2m", diff --git a/script/hooks/common.sh b/script/hooks/common.sh deleted file mode 100644 index 95f1aa18e..000000000 --- a/script/hooks/common.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: MIT-0 - -get_stash_count () { - readonly count="$(git rev-list --walk-reflogs --count refs/stash 2> /dev/null)" - if [ "${count}" = "" ]; then - echo "0" - else - echo "${count}" - fi -} - -STASH_COUNT_BEFORE="$(get_stash_count)" -DID_STASH () { - readonly STASH_COUNT_AFTER="$(get_stash_count)" - if [ "${STASH_COUNT_BEFORE}" != "${STASH_COUNT_AFTER}" ]; then - echo "x" # true - else - echo "" # false - fi -} - -IS_MERGING () { - if [ -f "$(git rev-parse --git-dir)/MERGE_HEAD" ]; then - echo "x" # true - else - echo "" # false - fi -} diff --git a/script/hooks/pre-commit b/script/hooks/pre-commit deleted file mode 100755 index 85bd083e5..000000000 --- a/script/hooks/pre-commit +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: MIT-0 - -. "$(dirname "$0")/../common.sh" - -# Pre -if [ -z "$(IS_MERGING)" ]; then - npm run format - git stash push --quiet --include-untracked --keep-index -fi - -# Script -npm run check -npm run format -git update-index --again - -# Post -if [ -n "$(DID_STASH)" ]; then - git stash pop --quiet -fi diff --git a/script/hooks/pre-push b/script/hooks/pre-push deleted file mode 100755 index 5d9f7e1af..000000000 --- a/script/hooks/pre-push +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: MIT-0 - -. "$(dirname "$0")/../common.sh" - -# Pre -if [ -z "$(IS_MERGING)" ]; then - git stash push --quiet --include-untracked -fi - -# Script -npm run check -npm run test:unit - -# Post -if [ -n "$(DID_STASH)" ]; then - git stash pop --quiet --index -fi