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

Reduce the noise #78

Open
nikolay opened this issue Sep 26, 2019 · 15 comments · Fixed by #130
Open

Reduce the noise #78

nikolay opened this issue Sep 26, 2019 · 15 comments · Fixed by #130
Assignees
Labels
enhancement

Comments

@nikolay
Copy link

@nikolay nikolay commented Sep 26, 2019

There's too much noise:

Lefthook v0.6.3
RUNNING HOOKS GROUP: pre-commit

  EXECUTE > yamllint
(SKIP. NO FILES FOR INSPECTING)

  EXECUTE > jsonnet-fmt
(SKIP. NO FILES FOR INSPECTING)

  EXECUTE > vault-policy-fmt

SUMMARY: (done in 479.47 seconds)
✔️  vault-policy-fmt

This is good for debugging purposes, but if you have tens of different commands and just changed a single file, seeing all this is not signal, but noise. Showing the program and the version number is unnecessary either (if one cares, they can see that with lefthook version).

@Arkweid
Copy link
Collaborator

@Arkweid Arkweid commented Sep 26, 2019

Hi @nikolay, thank you for feedback.
The reason why Lefthook v0.6.3 exists in the output, because we have a lot of inexperienced users, which have a problems with understanding which version they run. Yep it noisy, but help a lot for some group of users.
I can add a flag for config file, like short_output: true or only_summary: true.
What output format do you recommend?

@Arkweid Arkweid self-assigned this Sep 26, 2019
@Arkweid Arkweid added the enhancement label Sep 26, 2019
@nikolay
Copy link
Author

@nikolay nikolay commented Sep 26, 2019

Yes, keep the default "as is", but add options to limit the output as, honestly, I personally don't mind more info, but I know some people will be bothered and this can affect the adoption. It would be much easier for me to get buy-in if there's change-relevant output only.

@igoradamenko
Copy link

@igoradamenko igoradamenko commented Oct 2, 2019

Agreed. Usually I use -q on lint-staged during development to hide any output except errors. The reason is simple: I use WebStorm and it cuts git-hook output when it's too much long (for WS “too much” means “≈ more than 10 lines”). So these success messages can push out useful error messages into ugly popup which breaks formatting and completely unreadable.

I understand that it's not a lefthook's fault, but WS's. However I would much appreciate an option like silent: true.

(Anyway, thanks for the fast tool. I really like how it feels that it works at least 4 times faster than husky + lint-staged.)

@Arkweid
Copy link
Collaborator

@Arkweid Arkweid commented Oct 4, 2019

I think about modular output, like this one:

output:
  - meta #(version and which hook running)
  - failures #(output from runners with exit code nonzero)
  - success #(output from runners with exit code 0)
  - summary #(summary block)

@nikolay
Copy link
Author

@nikolay nikolay commented Oct 7, 2019

Thank you, @Arkweid! This looks granular enough!

@rbUUbr
Copy link
Contributor

@rbUUbr rbUUbr commented Jan 19, 2020

I think, it can be great to add logrus to this project to made it possible. wdyt?

@Arkweid
Copy link
Collaborator

@Arkweid Arkweid commented Jan 20, 2020

That make sense.

@ixti
Copy link

@ixti ixti commented Jan 20, 2020

I think about modular output, like this one:

output:
  - meta #(version and which hook running)
  - failures #(output from runners with exit code nonzero)
  - success #(output from runners with exit code 0)
  - summary #(summary block)

Would be nice if it would be possible to configure the output via ENV. And have an option to output summary only in case of failures only. Perfectly as one-liner. Right now it's kinda very difficult to use lefthook with tig.

@thieman
Copy link

@thieman thieman commented Feb 10, 2020

The reason why Lefthook v0.6.3 exists in the output, because we have a lot of inexperienced users, which have a problems with understanding which version they run. Yep it noisy, but help a lot for some group of users.

Other projects have solved this by adding an issue template reminding users to report their current version when posting an issue. That might be a less noisy way to achieve what you want here.

@nikolay
Copy link
Author

@nikolay nikolay commented Feb 10, 2020

@thieman Yes. This is a tool for people who use Git, so, it is assumed that if they know how to use git, they can find the version of a CLI tool easily.

@imajes
Copy link

@imajes imajes commented May 14, 2020

Yep - would be great to see this done too.

@Arkweid
Copy link
Collaborator

@Arkweid Arkweid commented Jul 10, 2020

Modular output merged in master.
It could be checked with this config:

skip_output:
  - meta #(version and which hook running)
  - success #(output from runners with exit code 0)

@Arkweid Arkweid reopened this Jul 10, 2020
@ixti
Copy link

@ixti ixti commented Jul 14, 2020

Is there any chance that there will be an option to configure it via ENV vars, e.g. LEFTHOOK_QUIET=meta,success

@Arkweid
Copy link
Collaborator

@Arkweid Arkweid commented Jul 15, 2020

@ixti Yea, why not. PR always welcome :)

@aleclarson
Copy link

@aleclarson aleclarson commented Oct 29, 2020

I have strong negative feelings about the log output of lefthook. 👀

Can we get a skip_output: true option that silences everything (except errors)? 😅

(I don't know Go, or I would contribute)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants