Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add husky - prefix to logged global error messages #1092

Merged
merged 1 commit into from Apr 28, 2022

Conversation

joshbalfour
Copy link
Contributor

@joshbalfour joshbalfour commented Jan 12, 2022

Hiya,

Spent some time today debugging an issue that I eventually traced back to husky, would have been nice to have the error message identified as such.

Admit this is probably more a yarn issue as all yarn gave me to go on was:

➤ YN0000: │ root@workspace:. STDERR fatal: not a git repository (or any of the parent directories): .git

But would appreciate this workaround being added, as it also bring it in line with your other logging.

Cheers!

@devinrhode2
Copy link

@devinrhode2 devinrhode2 commented Jan 13, 2022

Yarn 2 logs are ducking trash

@typicode
Copy link
Owner

@typicode typicode commented Feb 20, 2022

Thank you for the PR. Right now I can't see any output with Yarn 3. postinstall doesn't seem to be running, not sure why.

Could you try on your side with Yarn 3?

@devinrhode2
Copy link

@devinrhode2 devinrhode2 commented Feb 22, 2022

I think this is a great small change.

While yarn logging is very colorful, it has some major issues around exposing what's happening wrt npm scripts. I can say that writing to a file may be a reliable way to gain some insight into what npm scripts are running.

However, this is wholy un-necessary, looking at this code change, we can see it's extremely minor change. It may be good to double check that "husky - husky - FOO ERROR" is not possible

We could import a shared const for this string prefix, but better than that would be to have a shared logging function which adds the prefix if the prefix isn't already added. That way a shared const is not necessary.

@stale
Copy link

@stale stale bot commented Apr 23, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 23, 2022
@stale stale bot removed the wontfix label Apr 24, 2022
@typicode
Copy link
Owner

@typicode typicode commented Apr 28, 2022

Thank you @devinrhode2 @joshbalfour

@typicode typicode merged commit beaf645 into typicode:main Apr 28, 2022
@devinrhode2
Copy link

@devinrhode2 devinrhode2 commented May 8, 2022

@typicode sorry my reply seemingly doesn't answer your question

Thank you for the PR. Right now I can't see any output with Yarn 3. postinstall doesn't seem to be running, not sure why.

Could you try on your side with Yarn 3?

It does seem that postinstall is supported by yarn 3 here: https://yarnpkg.com/advanced/lifecycle-scripts

However, as I mentioned, you may not see your console.logs, but the script may still running. Outputting to file is one option, there are probably better strategies, maybe even a config option

kodiakhq bot pushed a commit to ToppleTheNun/npm-lockfile-version that referenced this issue May 8, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.0) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.0/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.0/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/ToppleTheNun/npm-lockfile-version).
hoonoh pushed a commit to hoonoh/aws-spot-price that referenced this issue May 9, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.0) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.0/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.0/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: "after 5pm on Friday,every weekend" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/hoonoh/aws-spot-price).

Co-authored-by: Renovate Bot <bot@renovateapp.com>
kodiakhq bot pushed a commit to mheob/vscode-snippets that referenced this issue May 14, 2022
[![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`^7.0.4` -> `^8.0.0`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.1) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.1/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.1/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.1`](https://togithub.com/typicode/husky/releases/v8.0.1)

[Compare Source](https://togithub.com/typicode/husky/compare/v8.0.0...v8.0.1)

-   fix: use POSIX equality operator

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: "before 3am on Friday" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] If you want to rebase/retry this PR, click this checkbox.

---

This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/mheob/vscode-snippets).
aviator-app bot pushed a commit to airplanedev/node-sdk that referenced this issue Jun 24, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://typicode.github.io/husky) ([source](https://togithub.com/typicode/husky)) | [`7.0.4` -> `8.0.1`](https://renovatebot.com/diffs/npm/husky/7.0.4/8.0.1) | [![age](https://badges.renovateapi.com/packages/npm/husky/8.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/husky/8.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/husky/8.0.1/compatibility-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/husky/8.0.1/confidence-slim/7.0.4)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky</summary>

### [`v8.0.1`](https://togithub.com/typicode/husky/releases/tag/v8.0.1)

[Compare Source](https://togithub.com/typicode/husky/compare/v8.0.0...v8.0.1)

-   fix: use POSIX equality operator

### [`v8.0.0`](https://togithub.com/typicode/husky/releases/tag/v8.0.0)

[Compare Source](https://togithub.com/typicode/husky/compare/v7.0.4...v8.0.0)

#### What's Changed

##### Feats

-   feat: add `husky -` prefix to logged global error messages by [@&#8203;joshbalfour](https://togithub.com/joshbalfour) in [typicode/husky#1092
-   feat: show `PATH` when command not found to improve debuggability
-   feat: drop Node 12 support
-   feat: skip install if `$HUSKY=0`

##### Fixes

-   fix: hook script use `/usr/bin/env sh` instead of direct path of `sh` by [@&#8203;skhaz](https://togithub.com/skhaz) in [typicode/husky#1051
-   fix: actually set 'husky_skip_init' as readonly in `./husky.sh` by [@&#8203;hyperupcall](https://togithub.com/hyperupcall) in [typicode/husky#1104
-   fix: force `basename`/`dirname` to treat `$0` as an argument by [@&#8203;mataha](https://togithub.com/mataha) in [typicode/husky#1132
-   fix: remove `git.io` links by [@&#8203;renbaoshuo](https://togithub.com/renbaoshuo) in [typicode/husky#1136

##### Docs

-   docs: fix uninstall via npm by [@&#8203;pddpd](https://togithub.com/pddpd) in [typicode/husky#1033
-   docs: add dog emoji as favicon by [@&#8203;jamiehaywood](https://togithub.com/jamiehaywood) in [typicode/husky#1095
-   docs: replace deprecated `npx --no-install` option with `npx --no` by [@&#8203;sibiraj-s](https://togithub.com/sibiraj-s) in [typicode/husky#1070
-   docs: add `pnpm` installation by [@&#8203;MohamadKh75](https://togithub.com/MohamadKh75) in [typicode/husky#1139

##### Chore

-   chore: update workflows by [@&#8203;tiziodcaio](https://togithub.com/tiziodcaio) in [typicode/husky#1125

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 5am on Thursday" in timezone America/New_York, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

 **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants