Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 36eb2e5
Merge: 6b8b1fb 364de37
Author: n.davitkovski <ndavitkovski@yahoo.com>
Date:   Mon Sep 5 18:55:52 2022 +0200

    react front-end

commit 6b8b1fb
Author: n.davitkovski <ndavitkovski@yahoo.com>
Date:   Mon Sep 5 16:00:48 2022 +0200

    Update pre-commit

commit 6fd620d
Author: Frank Harrison <frank@doublethefish.com>
Date:   Thu Jun 9 11:02:41 2022 +0100

    chore(docs): improves the documentation

    Clairifies:
     * install options
     * some differences between v4 and v8
     * how to create and manage githooks
     * how husky relates to git
     * how husky relates to npm/yarn

commit 33125bc
Author: Dong-Young Kim <31337.persona@gmail.com>
Date:   Sun Jun 19 11:25:30 2022 +0900

    docs: add double-hyphen flag between npx and the command to run (typicode#1164)

commit a2abf6c
Author: typicode <typicode@gmail.com>
Date:   Fri Jun 10 19:06:19 2022 +0200

    docs: update deprecated npm command

commit cf74170
Author: Sgryts <sergiigrytsaienko@gmail.com>
Date:   Fri Jun 10 12:05:05 2022 -0500

    docs: README update (typicode#1154)

    * docs: README update -
    replacing depricated npm set-script with npm  pkg set
    (typicode#1150)

    * docs: README update -
    replacing depricated npm set-script with npm pkg set
    (typicode#1150)

commit ee47218
Author: Carlo Corradini <carlo.ita98@gmail.com>
Date:   Sat May 21 03:22:48 2022 +0200

    chore: npx option --no-install replaced with --no -- due to deprecation (typicode#1149)

commit 616ed9f
Author: typicode <typicode@gmail.com>
Date:   Mon May 9 11:51:57 2022 +0200

    8.0.1

commit 8d0499a
Author: typicode <typicode@gmail.com>
Date:   Mon May 9 11:51:36 2022 +0200

    fix: use POSIX equality operator

commit 8e45818
Author: typicode <typicode@gmail.com>
Date:   Mon May 9 00:05:42 2022 +0200

    docs: v8 update

commit b72af0f
Author: typicode <typicode@gmail.com>
Date:   Sun May 8 23:40:15 2022 +0200

    chore: update version

commit 0f9ebb4
Author: typicode <typicode@gmail.com>
Date:   Sun May 8 23:05:22 2022 +0200

    feat: show PATH if command not found

commit 6d4ad09
Author: typicode <typicode@gmail.com>
Date:   Sun May 8 23:04:16 2022 +0200

    test: command not found message

commit 99169cb
Author: typicode <typicode@gmail.com>
Date:   Sun May 8 22:47:53 2022 +0200

    feat: skip install if $HUSKY=0

commit 69afc14
Author: Mohamad Khajavi <khajavi_mohamad@yahoo.com>
Date:   Sun May 1 07:47:58 2022 +0430

    docs: add pnpm installation (typicode#1139)

commit 25d0675
Author: Sibiraj <20282546+sibiraj-s@users.noreply.github.com>
Date:   Thu Apr 28 12:18:40 2022 +0530

    docs: replace deprecated npx option (typicode#1070)

    * docs: update deprecated npx option

    * docs: fix commitlint commands

    * Update docs/README.md

    * Update docs/README.md

    Co-authored-by: typicode <typicode@gmail.com>

commit 4661fd4
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 08:17:10 2022 +0200

    docs: fix windows workaround

commit d6abbd8
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 08:13:58 2022 +0200

    chore: skip windows npm 6 tests

commit 46e68bb
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 07:58:54 2022 +0200

    test: skip sub-dir

commit 46dcde5
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 07:46:08 2022 +0200

    test: skip sub-dir

commit 61a79db
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 07:25:33 2022 +0200

    chore: update package.json node version to 14

commit e030250
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 07:19:05 2022 +0200

    chore: update workflow

commit 1f8253c
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 07:09:31 2022 +0200

    chore: update devDependencies

    fix related ts error

commit ff1ec79
Author: Josh Balfour <josh@joshbalfour.co.uk>
Date:   Thu Apr 28 06:02:10 2022 +0100

    feat: add `husky -` prefix to logged global error messages (typicode#1092)

commit 3d06050
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 06:52:11 2022 +0200

    chore: update workflow

commit 1ca4e37
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 06:44:46 2022 +0200

    chore: update workflow

commit 208bcc4
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 06:25:41 2022 +0200

    chore: update workflow

commit ceb3b5d
Author: typicode <typicode@gmail.com>
Date:   Thu Apr 28 06:06:41 2022 +0200

    chore: update workflow

commit cc13539
Author: Daniele Basso <daniele05.bass@gmail.com>
Date:   Thu Apr 28 03:43:18 2022 +0000

    chore: update Workflows (typicode#1125)

    Remove nodejs 12 as it is EOL
    Updated workflows to use nodejs 16

commit 2b8c4df
Author: Baoshuo Ren <i@baoshuo.ren>
Date:   Wed Apr 27 11:44:49 2022 +0800

    chore: remove git.io (typicode#1136)

    All links on git.io will stop redirecting after April 29, 2022.

    - https://github.blog/changelog/2022-04-25-git-io-deprecation/

commit f925192
Author: mataha <mataha@users.noreply.github.com>
Date:   Sat Apr 16 15:55:12 2022 +0200

    fix: force `basename`/`dirname` to treat `$0` as an argument (typicode#1132)

    * fix: basename: force $0 to be treated as argument

    * fix: dirname: force $0 to be treated as argument

commit 2da1291
Author: typicode <typicode@gmail.com>
Date:   Mon Feb 21 01:34:12 2022 +0100

    docs: update yarn 2+ install

commit d27582f
Author: Edwin Kofler <24364012+hyperupcall@users.noreply.github.com>
Date:   Sun Feb 20 09:14:19 2022 -0800

    fix: actually set 'husky_skip_init' as readonly (typicode#1104)

    Previously, the script would export the empty 'readonly' variable, along
    with 'husky_skip_init' which has a value of 1. Now, the script sets
    'husky_skip_init' to 1, and properly gives is the readonly and exported
    attributes.

commit 8e1ff76
Author: typicode <typicode@gmail.com>
Date:   Sun Feb 20 17:43:31 2022 +0100

    docs: add another way to disable husky in prod

commit 0f3e012
Author: typicode <typicode@gmail.com>
Date:   Thu Feb 17 12:31:20 2022 +0100

    docs: update windows npx usage

commit 7818613
Author: Rodrigo Delduca <rodrigodelduca@gmail.com>
Date:   Thu Feb 17 02:55:20 2022 -0300

    feat: use /usr/bin/env sh instead of direct path of sh (typicode#1051)

commit de37f6d
Author: Jamie Haywood <jamie.haywood@gmail.com>
Date:   Tue Feb 1 22:42:26 2022 +0000

    feat: add dog emoji as favicon (typicode#1095)

commit c4f65f1
Author: Dr. Derek Austin <derekraustin@gmail.com>
Date:   Wed Oct 20 21:31:46 2021 -0500

    docs: wording [all Git hooks] (typicode#965)

commit 607ebcc
Author: pddpd <pddpengdi@gmail.com>
Date:   Thu Oct 21 10:28:49 2021 +0800

    docs: fix uninstall via npm (typicode#1033)

commit b0f8db7
Author: typicode <typicode@gmail.com>
Date:   Thu Oct 21 04:24:02 2021 +0200

    docs: improve uninstall instructions

commit 1109e57
Author: typicode <typicode@gmail.com>
Date:   Thu Oct 21 04:13:22 2021 +0200

    7.0.4

commit 2087da0
Author: typicode <typicode@gmail.com>
Date:   Thu Oct 21 04:13:02 2021 +0200

    revert: unsupported preuninstall

commit e2e3101
Author: typicode <typicode@gmail.com>
Date:   Thu Oct 21 04:03:25 2021 +0200

    7.0.3

commit 9917cca
Author: typicode <typicode@gmail.com>
Date:   Thu Oct 21 03:59:29 2021 +0200

    fix: on uninstall unset git core.hooksPath

commit d3ec839
Author: Wyntau Lau <lwent90@gmail.com>
Date:   Tue Oct 19 02:54:00 2021 +0800

    fix(actions): fix action name display (typicode#1059)

    fix variable node_version to  node-version

commit e933f0c
Author: typicode <typicode@gmail.com>
Date:   Sun Oct 10 16:23:38 2021 +0200

    docs: update "hooks not running" section

commit 7c36e31
Author: TAKAHASHI Shuuji <shuuji3@gmail.com>
Date:   Tue Sep 14 01:01:50 2021 +0000

    fix: update npm parameters on `docs/README.md` (typicode#1037)

commit 26b6bf4
Author: typicode <typicode@gmail.com>
Date:   Mon Sep 13 23:51:30 2021 +0200

    docs: add `npx husky add` workaround on Windows

commit 79c5c88
Author: typicode <typicode@gmail.com>
Date:   Sat Aug 28 08:34:25 2021 +0200

    fix: docs link

commit d78380b
Author: typicode <typicode@gmail.com>
Date:   Wed Aug 25 03:21:46 2021 +0200

    7.0.2

commit d57a008
Author: Andrey Ivlev <andreyivlev@pm.me>
Date:   Wed Aug 25 04:22:10 2021 +0300

    Fix pre-commit hook in WebStorm (typicode#1023)

commit 42fe4b7
Author: typicode <typicode@gmail.com>
Date:   Sat Jul 17 10:37:29 2021 +0200

    docs: update

commit 88fe7c3
Author: typicode <typicode@gmail.com>
Date:   Sat Jul 17 10:36:27 2021 +0200

    docs: update README.md

commit 32e2829
Author: HonkingGoose <34918129+HonkingGoose@users.noreply.github.com>
Date:   Tue Jul 13 02:08:10 2021 +0200

    ci: update actions/setup-node to v2, enable cache (typicode#1008)

    * ci: update actions/setup-node to v2

    * ci: enable npm package cache

    * Fix YAML syntax error

commit 5531c73
Author: Joël Galeran <Jolg42@users.noreply.github.com>
Date:   Wed Jul 7 16:12:10 2021 +0200

    fix: readme confusin condition to disable install in CI (typicode#1005)

commit e388495
Author: typicode <typicode@gmail.com>
Date:   Tue Jul 6 13:02:12 2021 +0200

    test: add test

commit e08bab2
Author: typicode <typicode@gmail.com>
Date:   Tue Jul 6 12:24:38 2021 +0200

    7.0.1

commit c19c2e2
Author: typicode <typicode@gmail.com>
Date:   Tue Jul 6 12:23:45 2021 +0200

    style: comment

commit e1efdf6
Author: Marco Carini <cmdcarini@gmail.com>
Date:   Tue Jul 6 05:17:32 2021 -0500

    fix: cover case where git rev-parse returns null (typicode#1001)

commit 80450dc
Author: typicode <typicode@gmail.com>
Date:   Tue Jul 6 12:06:00 2021 +0200

    docs: update Docker section

commit a46ae0f
Author: typicode <typicode@gmail.com>
Date:   Fri Jul 2 03:26:35 2021 +0200

    Create stale.yml

commit b06dc95
Author: typicode <typicode@gmail.com>
Date:   Fri Jul 2 02:33:01 2021 +0200

    docs: update Docker section

commit 7f062d6
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 07:53:08 2021 +0200

    docs: update

commit 42ddca2
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 07:35:37 2021 +0200

    docs: typo

commit 9eb76c6
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 07:27:27 2021 +0200

    chore: fix CI

commit b693ffe
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 07:17:14 2021 +0200

    chore: fix CI

commit fd043f6
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 06:56:54 2021 +0200

    chore: fix CI

commit a60b377
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 06:34:51 2021 +0200

    7.0.0

commit e49e5fb
Author: typicode <typicode@gmail.com>
Date:   Thu Jul 1 06:23:58 2021 +0200

    feat: husky 7

commit af03862
Author: Stefano Magni <nori.ste.magni@gmail.com>
Date:   Wed Jun 23 00:48:16 2021 +0200

    docs: align the examples (typicode#992)

    The "Locally installed binaries" section was missing a `# or` comment between the `npx` and `yarn` example. I brought the comment directly from the "HUSKY_GIT_PARAMS" section.

commit e79e0f7
Author: Phred Lane <fearphage@gmail.com>
Date:   Sun Jun 20 06:11:57 2021 -0500

    refactor(husky-init): removed duplicated code (typicode#989)

commit e5fa931
Author: typicode <typicode@gmail.com>
Date:   Sun Jun 20 11:48:18 2021 +0200

    Update README.md

commit c7eab52
Author: typicode <typicode@gmail.com>
Date:   Sun Jun 20 11:47:07 2021 +0200

    Update README.md

commit 7526a01
Author: typicode <typicode@gmail.com>
Date:   Sun Jun 20 11:46:26 2021 +0200

    Update README.md

commit 614f77f
Author: typicode <typicode@gmail.com>
Date:   Sun Jun 20 11:45:36 2021 +0200

    Update README.md

commit 7b7f509
Author: nbelakovski <nbelakovski@users.noreply.github.com>
Date:   Thu Jun 17 23:30:32 2021 -0700

    docs: use --save-dev instead of -D

    Expanded -D into the long option, so that those who aren't as familiar with the ecosystem don't have to look it up.

commit 7f8e8b8
Author: Chuck <chuck@eclecticsaddlebag.com>
Date:   Fri Jun 4 10:38:18 2021 -0400

    Update README.md (typicode#984)

    Small typo

commit 883f8c4
Author: typicode <typicode@gmail.com>
Date:   Wed May 26 09:53:13 2021 +0200

    docs: update

commit d12efa2
Author: typicode <typicode@gmail.com>
Date:   Sat May 22 07:50:28 2021 +0200

    docs: add sharing hooks recipe
  • Loading branch information
nikoladavitkovski committed Sep 6, 2022
1 parent 364de37 commit 96222fe
Show file tree
Hide file tree
Showing 11 changed files with 1,317 additions and 1,985 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/node.js.yml
Expand Up @@ -16,12 +16,16 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
<<<<<<< HEAD
- run: npm --version
=======
<<<<<<< HEAD
- run: npm --version
=======
- name: npm 7
run: npm i -g npm@7
>>>>>>> upstream/fix-ci
>>>>>>> 364de37ca2f0a20a802c02caf4798e3f78487f31
- run: npm ci --ignore-scripts
- run: npm test

Expand Down
69 changes: 69 additions & 0 deletions README.md
@@ -1,11 +1,79 @@
<<<<<<< HEAD
# husky
=======
[![Financial Contributors on Open Collective](https://opencollective.com/husky/all/badge.svg?label=financial+contributors)](https://opencollective.com/husky) [![](https://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![Node.js CI](https://github.com/typicode/husky/workflows/Node.js%20CI/badge.svg)](https://github.com/typicode/husky/actions)
>>>>>>> 364de37ca2f0a20a802c02caf4798e3f78487f31
> Modern native git hooks made easy
Husky improves your commits and more 🐶 _woof!_

You can use it to **lint your commit messages**, **run tests**, **lint code**, etc... when you commit or push. Husky supports [all Git hooks](https://git-scm.com/docs/githooks).

<<<<<<< HEAD
## Easy install (reccomended)

`husky-init` is a one-time command to configure a project with husky.

It installs husky into your project and auto-configures your package.json,
ensuring that every time you run `yarn|npm install` git is then configured to
use your hooks (so you don't have to worry about it again).

```shell
npx husky-init && npm install # npm
npx husky-init && yarn # Yarn 1
yarn dlx husky-init --yarn2 && yarn # Yarn 2+
pnpm dlx husky-init && pnpm install # pnpm
```

It will:
* install husky
* modify `package.json` (adding a
[`prepare`](https://docs.npmjs.com/cli/v8/using-npm/scripts#prepare-and-prepublish)
script)
* create a sample `pre-commit` hook that you can edit. By default this runs
`npm test` when you commit.

## Manual Install

1. Install `husky`

```shell
npm install husky --save-dev
yarn add --dev husky
```

2. Enable Git hooks

```shell
npx husky install # will configure git to use .husky/ by default
```

3. To automatically have Git hooks enabled after every npm/yarn install, edit
`package.json` to use one of the [npm/yarm lifecyle
hooks](https://docs.npmjs.com/cli/v8/using-npm/scripts#prepare-and-prepublish)
e.g. `prepare`.


```shell
npm pkg set scripts.prepare="husky install"
```

You should have:

```js
// package.json
{
"scripts": {
"prepare": "husky install"
}
}
```

# Documentation

https://typicode.github.io/husky
=======
IMPORTANT: Only supports [Git 2.9](https://github.com/git/git/blob/master/Documentation/RelNotes/2.9.0.txt#L127-L128) and above.

# Migrate from 4 to 8
Expand Down Expand Up @@ -605,3 +673,4 @@ GitHub sponsors can be viewed on my [profile](https://github.com/typicode). All
# License

MIT
>>>>>>> 364de37ca2f0a20a802c02caf4798e3f78487f31
7 changes: 7 additions & 0 deletions docs/README.md
Expand Up @@ -182,7 +182,11 @@ e.g. `prepare`.


```shell
<<<<<<< HEAD
npm pkg set scripts.prepare "husky install"
=======
npm pkg set scripts.prepare="husky install"
>>>>>>> 364de37ca2f0a20a802c02caf4798e3f78487f31
```

You should have:
Expand Down Expand Up @@ -369,6 +373,8 @@ if (!isCi) {
}
```

<<<<<<< HEAD
=======
You can also use your own logging functions if needed:

```js
Expand All @@ -381,6 +387,7 @@ const husky = configure({
husky.install()
```

>>>>>>> 364de37ca2f0a20a802c02caf4798e3f78487f31
Or make `prepare` script fail silently if husky is not installed:

```json
Expand Down

0 comments on commit 96222fe

Please sign in to comment.