git-hooks-list-4.2.1/000077500000000000000000000000001513311363700143765ustar00rootroot00000000000000git-hooks-list-4.2.1/.editorconfig000066400000000000000000000012321513311363700170510ustar00rootroot00000000000000# config file for `editorconfig` # # update: wget -O .editorconfig https://git.io/fjVjz # document: https://editorconfig.org # # top-most EditorConfig file root = true # all files [*] # Set default charset charset = utf-8 # Unix-style newlines end_of_line = lf # with a newline ending every file insert_final_newline = true # 2 space indentation indent_style = space indent_size = 2 # remove any whitespace characters preceding newline characters trim_trailing_whitespace = true # overrides # python overrides [*.py] indent_size = 4 # cmd overrides [*.{bat,cmd}] charset = ansi end_of_line = crlf # markdown [*.{md,markdown}] insert_final_newline = false git-hooks-list-4.2.1/.gitattributes000066400000000000000000000000231513311363700172640ustar00rootroot00000000000000* text=auto eol=lf git-hooks-list-4.2.1/.github/000077500000000000000000000000001513311363700157365ustar00rootroot00000000000000git-hooks-list-4.2.1/.github/SECURITY.md000066400000000000000000000003211513311363700175230ustar00rootroot00000000000000# Security Policy ## Reporting a Vulnerability To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security). Tidelift will coordinate the fix and disclosure. git-hooks-list-4.2.1/.github/dependabot.yml000066400000000000000000000016661513311363700205770ustar00rootroot00000000000000# config file for `dependabot` # # update: wget -O config.yml https://git.io/fjVjR # document: https://dependabot.com/docs/config-file/ # version: 2 updates: - package-ecosystem: "npm" directory: "/" schedule: interval: "daily" time: "06:00" timezone: "Asia/Shanghai" allow: - dependency-type: "all" assignees: - "fisker" # commit-message: ignore: - dependency-name: "caniuse-lite" - dependency-name: "caniuse-db" - dependency-name: "electron-to-chromium" # labels: # - "label-name" # milestone: open-pull-requests-limit: 99 # pull-request-branch-name: # separator: "-" rebase-strategy: "auto" reviewers: - "fisker" # target-branch: "develop" versioning-strategy: "increase" - package-ecosystem: "github-actions" directory: "/" schedule: interval: "daily" time: "06:00" timezone: "Asia/Shanghai" git-hooks-list-4.2.1/.github/renovate.json5000066400000000000000000000000611513311363700205360ustar00rootroot00000000000000{ extends: ["@fisker", ":assignee(fisker)"], } git-hooks-list-4.2.1/.github/workflows/000077500000000000000000000000001513311363700177735ustar00rootroot00000000000000git-hooks-list-4.2.1/.github/workflows/automated-fix.yml000066400000000000000000000005261513311363700232700ustar00rootroot00000000000000name: autofix.ci # needed to securely identify the workflow on: pull_request: concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: fix: if: github.repository == 'fisker/git-hooks-list' name: Run automated fix uses: fisker/shared-workflows/.github/workflows/automated-fix.yml@main git-hooks-list-4.2.1/.github/workflows/automated-update.yml000066400000000000000000000007671513311363700237730ustar00rootroot00000000000000name: Update data on: workflow_dispatch: schedule: # “At 00:00 on Friday.” https://crontab.guru/#0_0_*_*_5 - cron: "0 0 * * 5" concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: update: if: github.event_name != 'schedule' || github.repository == 'fisker/git-hooks-list' permissions: contents: write pull-requests: write name: Run update uses: fisker/shared-workflows/.github/workflows/scheduled-task.yml@main git-hooks-list-4.2.1/.github/workflows/continuous-integration.yml000066400000000000000000000040601513311363700252450ustar00rootroot00000000000000name: CI on: push: branches: - main pull_request: # schedule: # - cron: "0 23 * * 6" jobs: test: strategy: fail-fast: false matrix: os: - "ubuntu-latest" - "macos-latest" - "windows-latest" node_version: - "24" - "22" - "20" # exclude: # - os: "macos-latest" # node_version: "12" name: Node.js ${{ matrix.node_version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} env: YARN_ENABLE_IMMUTABLE_INSTALLS: false # needs: [build] steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: ${{ matrix.node_version }} - name: Install Dependencies run: yarn # - name: Download Artifact # uses: actions/download-artifact@v4 # with: # name: dist # path: dist - name: Run Test run: yarn test-coverage - uses: codecov/codecov-action@v5 with: fail_ci_if_error: true disable_search: true files: coverage/lcov.info token: ${{ secrets.CODECOV_TOKEN }} lint: name: Lint runs-on: ubuntu-latest env: YARN_ENABLE_IMMUTABLE_INSTALLS: false steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 - name: Install Dependencies run: yarn - name: Run Lint run: yarn lint # build: # name: Build # runs-on: ubuntu-latest # env: # YARN_ENABLE_IMMUTABLE_INSTALLS: false # steps: # - name: Checkout # uses: actions/checkout@v4 # - name: Setup Node.js # uses: actions/setup-node@v4 # - name: Install Dependencies # run: yarn # - name: Build Package # run: yarn build # - name: Upload Artifact # uses: actions/upload-artifact@v4 # with: # name: dist # path: dist git-hooks-list-4.2.1/.github/workflows/publish.yml000066400000000000000000000007201513311363700221630ustar00rootroot00000000000000name: Publish Package on: push: tags: - v* permissions: {} jobs: publish: runs-on: ubuntu-latest permissions: id-token: write contents: read steps: - uses: actions/checkout@v6 - uses: actions/setup-node@v6 with: node-version: "lts/*" - run: npm pkg delete scripts devDependencies packageManager c8 - run: | node --version npm --version - run: npm publish git-hooks-list-4.2.1/.gitignore000066400000000000000000000027761513311363700164020ustar00rootroot00000000000000# ignore file for git project # # update: wget -O .gitignore https://git.io/fjXI5 # # Base on https://www.gitignore.io/api/node ### Node ### # Logs logs *.log npm-debug.log* yarn-debug.log* yarn-error.log* lerna-debug.log* yarn.lock # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # Runtime data pids *.pid *.seed *.pid.lock # Directory for instrumented libs generated by jscoverage/JSCover lib-cov # Coverage directory used by tools like istanbul coverage # nyc test coverage .nyc_output # Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) .grunt # Bower dependency directory (https://bower.io/) bower_components # node-waf configuration .lock-wscript # Compiled binary addons (https://nodejs.org/api/addons.html) build/Release # Dependency directories node_modules/ jspm_packages/ # TypeScript v1 declaration files typings/ # Optional npm cache directory .npm # Optional eslint cache .eslintcache # Optional REPL history .node_repl_history # Output of 'npm pack' *.tgz # Yarn Integrity file .yarn-integrity # dotenv environment variables file .env .env.test # parcel-bundler cache (https://parceljs.org/) .cache # next.js build output .next # nuxt.js build output .nuxt # vuepress build output .vuepress/dist # Serverless directories .serverless/ # FuseBox cache .fusebox/ # DynamoDB Local files .dynamodb/ # Yarn .yarn/cache/ .yarn/build-state.yml .yarn/install-state.gz .pnp.js # project ignore files .deleted/ dist/ git-hooks-list-4.2.1/.husky/000077500000000000000000000000001513311363700156175ustar00rootroot00000000000000git-hooks-list-4.2.1/.husky/pre-commit000066400000000000000000000000201513311363700176060ustar00rootroot00000000000000npx lint-staged git-hooks-list-4.2.1/.markdownlint-cli2.cjs000066400000000000000000000005371513311363700205220ustar00rootroot00000000000000/*! * config file for `markdownlint-cli2` * * update: wget -O .eslintrc.js https://git.io/fjVjK * document: https://github.com/DavidAnson/markdownlint-cli2 */ /* @fisker/markdownlint-cli2-config https://github.com/fisker/shared-configs/tree/main/packages/markdownlint-cli2-config */ module.exports = require('@fisker/markdownlint-cli2-config') git-hooks-list-4.2.1/.npmrc000066400000000000000000000000421513311363700155120ustar00rootroot00000000000000save-prefix="" package-lock=false git-hooks-list-4.2.1/.prettierignore000066400000000000000000000007501513311363700174430ustar00rootroot00000000000000# ignore file for `prettier` # # update: wget -O .prettierignore https://git.io/fjVj5 # document: https://prettier.io/docs/en/ignore.html#ignoring-files # # also prettier dot files !.* # vendors **/node_modules/** **/vendors/** **/vendor/** **/third-party/** # build file **/dist/** **/*.min.* # fixtures **/fixtures/** # test .nyc_output/** coverage/** # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json # yarn .yarn # project glob git-hooks-list-4.2.1/.release-it.json000066400000000000000000000004021513311363700173750ustar00rootroot00000000000000{ "$schema": "https://unpkg.com/release-it/schema/release-it.json", "git": { "commitMessage": "chore: release v${version}", "tagName": "v${version}" }, "github": { "release": true }, "npm": { "publish": false }, "hooks": {} } git-hooks-list-4.2.1/.yarnrc000066400000000000000000000000171513311363700156730ustar00rootroot00000000000000save-prefix "" git-hooks-list-4.2.1/.yarnrc.yml000066400000000000000000000001721513311363700164750ustar00rootroot00000000000000defaultSemverRangePrefix: "" enableGlobalCache: true nodeLinker: node-modules yarnPath: .yarn/releases/yarn-4.12.0.cjs git-hooks-list-4.2.1/eslint.config.mjs000066400000000000000000000000561513311363700176540ustar00rootroot00000000000000export {default} from '@fisker/eslint-config' git-hooks-list-4.2.1/index.d.ts000066400000000000000000000014341513311363700163010ustar00rootroot00000000000000/** List of Git hooks. @example ```js import gitHooks from 'git-hooks-list' console.log(gitHooks) //-> ['applypatch-msg', 'pre-applypatch', 'post-applypatch', ... 25 more items] ``` */ declare const gitHooks: readonly [ 'applypatch-msg', 'pre-applypatch', 'post-applypatch', 'pre-commit', 'pre-merge-commit', 'prepare-commit-msg', 'commit-msg', 'post-commit', 'pre-rebase', 'post-checkout', 'post-merge', 'pre-push', 'pre-receive', 'update', 'proc-receive', 'post-receive', 'post-update', 'reference-transaction', 'push-to-checkout', 'pre-auto-gc', 'post-rewrite', 'sendemail-validate', 'fsmonitor-watchman', 'p4-changelist', 'p4-prepare-changelist', 'p4-post-changelist', 'p4-pre-submit', 'post-index-change', ] export default gitHooks git-hooks-list-4.2.1/index.js000066400000000000000000000000711513311363700160410ustar00rootroot00000000000000export {default} from './index.json' with {type: 'json'} git-hooks-list-4.2.1/index.json000066400000000000000000000010461513311363700164010ustar00rootroot00000000000000[ "applypatch-msg", "pre-applypatch", "post-applypatch", "pre-commit", "pre-merge-commit", "prepare-commit-msg", "commit-msg", "post-commit", "pre-rebase", "post-checkout", "post-merge", "pre-push", "pre-receive", "update", "proc-receive", "post-receive", "post-update", "reference-transaction", "push-to-checkout", "pre-auto-gc", "post-rewrite", "sendemail-validate", "fsmonitor-watchman", "p4-changelist", "p4-prepare-changelist", "p4-post-changelist", "p4-pre-submit", "post-index-change" ] git-hooks-list-4.2.1/license000066400000000000000000000021351513311363700157440ustar00rootroot00000000000000MIT License Copyright (c) fisker Cheung (https://www.fiskercheung.com/) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. git-hooks-list-4.2.1/lint-staged.config.cjs000066400000000000000000000003071513311363700205560ustar00rootroot00000000000000/*! * config file for `lint-staged` * * update: wget -O lint-staged.config.js https://git.io/fjVj9 * document: https://git.io/fhNpF * */ module.exports = require('@fisker/lint-staged-config') git-hooks-list-4.2.1/package.json000066400000000000000000000047351513311363700166750ustar00rootroot00000000000000{ "name": "git-hooks-list", "version": "4.2.1", "description": "List of Git hooks", "keywords": [ "git", "hooks", "list" ], "homepage": "https://github.com/fisker/git-hooks-list#readme", "bugs": { "url": "https://github.com/fisker/git-hooks-list/issues" }, "repository": "fisker/git-hooks-list", "funding": "https://github.com/fisker/git-hooks-list?sponsor=1", "license": "MIT", "author": { "name": "fisker Cheung", "email": "lionkay@gmail.com", "url": "https://www.fiskercheung.com/" }, "sideEffects": false, "type": "module", "exports": { ".": { "types": "./index.d.ts", "require": "./index.json", "default": "./index.js" }, "./*": "./*" }, "main": "index.json", "jsdelivr": "index.json", "unpkg": "index.json", "browser": "index.json", "files": [ "index.d.ts", "index.json", "index.js" ], "scripts": { "clean": "run-p \"clean:*\"", "clean:dist": "del-cli dist", "dist": "run-p \"dist:*\"", "dist:npm": "release-it", "fix": "run-p \"fix:*\"", "fix:eslint": "yarn lint:eslint --fix", "fix:markdown": "markdownlint-cli2 --fix", "fix:package-json": "sort-package-json \"package.json\" \"packages/*/package.json\"", "fix:prettier": "yarn lint:prettier --write", "lint": "run-p \"lint:*\"", "lint:eslint": "eslint", "lint:markdown": "markdownlint-cli2", "lint:package-json": "yarn run fix:package-json --check", "lint:prettier": "prettier . --check", "prepare": "husky", "release": "run-s lint test fix dist", "test": "node --test", "test-coverage": "c8 yarn test", "update": "node scripts/update.js" }, "c8": { "include": [ "index.js" ], "reporter": [ "text", "lcov" ] }, "devDependencies": { "@fisker/eslint-config": "15.4.0", "@fisker/husky-config": "4.2.0", "@fisker/lint-staged-config": "3.4.0", "@fisker/markdownlint-cli2-config": "0.1.0", "@fisker/prettier-config": "5.3.0", "c8": "10.1.3", "cheerio": "1.1.2", "del-cli": "7.0.0", "eslint": "9.39.2", "husky": "9.1.7", "lint-staged": "16.2.7", "markdownlint-cli2": "0.20.0", "npm-run-all2": "8.0.4", "outdent": "0.8.0", "prettier": "3.8.0", "release-it": "19.2.3", "sort-package-json": "3.6.0", "write-prettier-file": "3.0.3" }, "packageManager": "yarn@4.12.0", "publishConfig": { "access": "public", "registry": "https://registry.npmjs.org/" } } git-hooks-list-4.2.1/prettier.config.mjs000066400000000000000000000000601513311363700202070ustar00rootroot00000000000000export {default} from '@fisker/prettier-config' git-hooks-list-4.2.1/readme.md000066400000000000000000000024411513311363700161560ustar00rootroot00000000000000# git-hooks-list [![Build Status][github_actions_badge]][github_actions_link] [![Coverage][coveralls_badge]][coveralls_link] [![Npm Version][package_version_badge]][package_link] [![MIT License][license_badge]][license_link] [github_actions_badge]: https://img.shields.io/github/actions/workflow/status/fisker/git-hooks-list/continuous-integration.yml?style=flat-square [github_actions_link]: https://github.com/fisker/git-hooks-list/actions?query=branch%3Amain [coveralls_badge]: https://img.shields.io/coveralls/github/fisker/git-hooks-list/main?style=flat-square [coveralls_link]: https://coveralls.io/github/fisker/git-hooks-list?branch=main [license_badge]: https://img.shields.io/npm/l/git-hooks-list.svg?style=flat-square [license_link]: https://github.com/fisker/git-hooks-list/blob/main/license [package_version_badge]: https://img.shields.io/npm/v/git-hooks-list.svg?style=flat-square [package_link]: https://www.npmjs.com/package/git-hooks-list > List of Git hooks Data from [Git - githooks Documentation](https://git-scm.com/docs/githooks) ## Install ```bash yarn add git-hooks-list ``` ## Usage ```js import gitHooks from 'git-hooks-list' console.log(gitHooks) //-> ['applypatch-msg', 'pre-applypatch', 'post-applypatch', ... 25 more items] ``` git-hooks-list-4.2.1/scripts/000077500000000000000000000000001513311363700160655ustar00rootroot00000000000000git-hooks-list-4.2.1/scripts/fetch-repository.js000066400000000000000000000023671513311363700217410ustar00rootroot00000000000000import fetchText from './fetch-text.js' // https://github.com/git/git/blob/HEAD/Documentation/githooks.adoc const SOURCE_URLS = [ 'https://raw.githubusercontent.com/git/git/HEAD/Documentation/githooks.adoc', // 'https://cdn.jsdelivr.net/gh/git/git/Documentation/githooks.adoc', 'https://gh-proxy.com/github.com/git/git/blob/HEAD/Documentation/githooks.adoc', ] const HOOKS_START_MARK = 'HOOKS' function* getHooks(text) { const lines = text.split('\n') let foundHooksStartMark = false for (let index = 0; index < lines.length - 1; index++) { const line = lines[index] const nextLine = lines[index + 1] if (!foundHooksStartMark) { if ( line === HOOKS_START_MARK && nextLine === '-'.repeat(HOOKS_START_MARK.length) ) { foundHooksStartMark = true // eslint-disable-next-line sonarjs/updated-loop-counter index += 1 } continue } if (/^[\da-z-]+$/u.test(line) && nextLine === '~'.repeat(line.length)) { yield line // eslint-disable-next-line sonarjs/updated-loop-counter index += 1 } } } async function fetchData() { const text = await Promise.any(SOURCE_URLS.map((url) => fetchText(url))) return [...getHooks(text)] } export default fetchData git-hooks-list-4.2.1/scripts/fetch-text.js000066400000000000000000000016351513311363700205030ustar00rootroot00000000000000import fs from 'node:fs/promises' const CACHE_DIRECTORY = new URL('../.cache/', import.meta.url) const CACHE_TIME = 60 * 60 * 1000 // One hour const hash = (string) => [...string] .reduce( (accumulator, character) => accumulator + character.codePointAt(0), 0, ) .toString(16) const SEPARATOR = `\n${'-'.repeat(80)}\n\n` async function fetchText(url) { const cacheFile = new URL(hash(url), CACHE_DIRECTORY) let cached = '' try { cached = await fs.readFile(cacheFile, 'utf8') } catch { // No op } if (cached) { const [time, text] = cached.split(SEPARATOR) if (Date.now() - Number(time) < CACHE_TIME) { return text } } const response = await fetch(url) const text = await response.text() await fs.mkdir(CACHE_DIRECTORY, {recursive: true}) await fs.writeFile(cacheFile, [Date.now(), text].join(SEPARATOR)) return text } export default fetchText git-hooks-list-4.2.1/scripts/fetch-website.js000066400000000000000000000027501513311363700211600ustar00rootroot00000000000000import * as cheerio from 'cheerio' import fetchText from './fetch-text.js' const GIT_DOCUMENTATION_URL = 'https://git-scm.com/docs/githooks' const cheerioObjectToArray = (elements, $) => // eslint-disable-next-line unicorn/prefer-spread Array.from(elements).map((element) => $(element)) async function fetchData() { const html = await fetchText(GIT_DOCUMENTATION_URL) const $ = cheerio.load(html) const sections = Object.fromEntries( cheerioObjectToArray($('.sect1'), $) .map((section) => { const anchor = section.find('a.anchor') const parent = anchor.parent() const id = parent.attr('id').replace(/^_/, '') if (anchor.attr('href') !== `#_${id}`) { return } const body = section.find('.sectionbody') return [id, $(body)] }) .filter(Boolean), ) const hooks = cheerioObjectToArray(sections.hooks.find('.sect2'), $) .map((section) => { const anchor = section.find('a.anchor').eq(0) const parent = anchor.parent() const id = parent.attr('id') if (anchor.attr('href') !== `#${id}`) { return } const hook = parent.text().trim() return { hook, description: cheerioObjectToArray(section.find('.paragraph'), $) .map((paragraph) => paragraph.text()) .join('\n') .replaceAll(/\n+/g, '\n') .trim(), } }) .filter(Boolean) return hooks.map(({hook}) => hook) } export default fetchData git-hooks-list-4.2.1/scripts/update.js000066400000000000000000000027651513311363700177170ustar00rootroot00000000000000import assert from 'node:assert/strict' import fs from 'node:fs/promises' import {inspect} from 'node:util' import {outdent} from 'outdent' import writePrettierFile from 'write-prettier-file' import fetchData from './fetch-repository.js' // import fetchData from './fetch-website.js' const gitHooks = await fetchData() await writePrettierFile( new URL('../index.json', import.meta.url), JSON.stringify(gitHooks, undefined, 2), ) const example = outdent` \`\`\`js import gitHooks from 'git-hooks-list' console.log(gitHooks) //-> ${inspect(gitHooks, {maxArrayLength: 3}) .replaceAll('\n', '') .replaceAll(' ', '') .replaceAll(',', ', ')} \`\`\` ` await writePrettierFile( new URL('../index.d.ts', import.meta.url), outdent` /** List of Git hooks. @example ${example} */ declare const gitHooks: readonly ${JSON.stringify(gitHooks, undefined, 2)}; export default gitHooks; `, ) { const readmeFile = new URL('../readme.md', import.meta.url) const original = await fs.readFile(readmeFile, 'utf8') const startMark = '' const endMark = '' const startMarkIndex = original.indexOf(startMark) assert.ok(startMarkIndex !== -1) const endMarkIndex = original.indexOf(endMark, startMarkIndex) assert.ok(endMarkIndex !== -1) const updated = [ original.slice(0, startMarkIndex + startMark.length), example, original.slice(endMarkIndex), ].join('\n') await writePrettierFile(readmeFile, updated) } git-hooks-list-4.2.1/test.js000066400000000000000000000032071513311363700157150ustar00rootroot00000000000000import assert from 'node:assert/strict' import fs from 'node:fs' import {test} from 'node:test' import gitHooks from './index.js' import fetchRepository from './scripts/fetch-repository.js' import fetchWebsite from './scripts/fetch-website.js' const SAMPLE_EXTENSION = '.sample' test('main', () => { assert.ok(Array.isArray(gitHooks), 'Git hooks should be an array.') assert.ok(gitHooks.length !== 0, 'Git hooks should not be empty.') assert.ok( gitHooks.length === new Set(gitHooks).size, 'Git hooks should be unique.', ) assert.ok( gitHooks.includes('commit-msg'), 'Git hooks should has `commit-msg`.', ) }) test('.git/hooks', () => { const files = fs.readdirSync('.git/hooks') const hooksInRepository = new Set([ ...files.filter((file) => !file.includes('.')), ...files .filter((file) => file.endsWith(SAMPLE_EXTENSION)) .map((file) => file.slice(0, -SAMPLE_EXTENSION.length)), ]) const set = new Set(gitHooks) assert.ok(hooksInRepository.length !== 0) for (const hook of hooksInRepository) { assert.ok(set.has(hook), `Git hooks should has ${hook}.`) } }) test('git/git repository', async () => { const dataFromRepository = await fetchRepository() assert.deepEqual( gitHooks, dataFromRepository, 'Git hooks should has be same as data from git/git repository.', ) }) test('git-scm.com', async () => { const dataFromWebsite = await fetchWebsite() assert.ok(gitHooks.length >= dataFromWebsite.length) for (const hook of dataFromWebsite) { assert.ok( gitHooks.includes(hook), `Git hooks should has documented ${hook} hook from git-scm.com.`, ) } })