houseabsolute / precious

One code quality tool to rule them all
Apache License 2.0
82 stars 4 forks source link

Precious should print stdout on unexpected exit code even if there is no stderr #28

Closed oschwald closed 2 years ago

oschwald commented 2 years ago

This is a follow-up to #26. The particular linter I am running into this with is golangci-lint, which outputs to stdout. You can reproduce this with the test script from #26 but removing the line that outputs to stderr.

I'd be happy to submit a PR, but I suspect some refactoring might make sense as I don't know if it makes sense to distinguish between UnexpectedExitCode and UnexpectedExitCodeWithStderr or, if it does, maybe there should be four separate enum values for the four combinations.

autarch commented 2 years ago

I just pushed a branch named command-output that changes this. If a command exits with an unexpected code and has either stdout or stderr, you'll always see that. I also tweaked exactly how the error was formatted so it says if one of stdout or stderr was empty.

autarch commented 2 years ago

I also combined those two error variants into just one. I agree that this makes more sense.

oschwald commented 2 years ago

Thanks!

autarch commented 2 years ago

Fixed in v0.1.7.

oschwald commented 2 years ago

Thanks again.

While reviewing the changes, I saw that your commits signed with your SSH key are "unverified". GitHub recently added SSH commit verification. You just need to add your public key as a signing key.

autarch commented 2 years ago

While reviewing the changes, I saw that your commits signed with your SSH key are "unverified". GitHub recently added SSH commit verification. You just need to add your public key as a signing key.

Yeah, I'm confused about this. The key it says is unverified was already in my profile.

autarch commented 2 years ago

Aha, I have to add it again as a signing key. That fixed it.