Skip to content
This repository has been archived by the owner on Jan 25, 2021. It is now read-only.

Blank output and unexpected successful command #3

Open
arthurdenner opened this issue Apr 10, 2020 · 3 comments
Open

Blank output and unexpected successful command #3

arthurdenner opened this issue Apr 10, 2020 · 3 comments

Comments

@arthurdenner
Copy link

arthurdenner commented Apr 10, 2020

Hi! 👋

While trying out this package, I noticed that outputs from commands such as flutter format, flutter analyze and flutter test are not displayed because even though result.exitCode is 1, the output is in result.stdout instead of result.stderr. Therefore, we get a blank output.

Also, if result.exitCode is 1, I think it should be propagated/forwared, so whatever command you ran will fail. Currently, if I ran git push in a repo with failing test or invalid syntax, I won't see any output and the command will succeed.

I've tried an approach to solve this and can send a PR if you agree with the points above.

Example repo: https://github.com/arthurdenner/lefthook_error_example

In the repo above, the last commit should've failed, but it didn't.

Screenshot 2020-04-10 at 16 15 06

@togiberlin
Copy link

togiberlin commented May 12, 2020

I can confirm.

pre-commit with flutter format runs fine.
pre-push with flutter analyze and flutter test didn't work - no output.

Tested on Mac OS X Catalina 10.15.4

@arthurdenner
Copy link
Author

@togiberlin, I ended up using just Lefthook itself and it's working fine.

Then I wrote a blog post about it - see here.

@togiberlin
Copy link

@arthurdenner Yeah, same here. I just ended up installing it via homebrew.

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

No branches or pull requests

2 participants