bluwy/publint

Suggestions as error in CLI mode

Closed this issue · 3 comments

Would be great to be able to treat suggestions as errors in CLI. An exit code of 1 could then crash a prepublish hook, and make sure a human reads the suggestions.

(Same as #38, but for suggestions.)

(Thank you for your tool! ❤️)

Hey! I'm a bit afraid of adding this feature as suggestions work a bit differently to warnings and errors. Usually suggestions can be fine to be ignored, but definitely encouraged to apply, but that often requires breaking changes from the library which they may not be able to do as quickly.

As new feature requests or best practices come along and added as suggestions, it would be a big problem if it can halt someone's release process. On the other hand, #38 is acceptable since warnings can indicate something is not working as you'd intend to (though not the end of the world), and some would prefer always knowing of it.

So at the moment, I'd prefer sticking with only the --strict option for now and suggestions are still left as is.

To be clear, I am only suggestion an opt-in option. “--very-strict”, if you will. I think this addresses most of your concerns. Naturally, people using it will not be blocked on publint unknowingly being upgraded and blocking their publishes.

Without that option, it seems that some of the work going into creating good suggestions will be lost, as users who use publint in CI will not see those suggestions, ever. It’s one thing to add publint to CI and enjoy, it’s another to remember to manually run it in an interactive session.

But I don’t mean to convince you! I was only bringing it to light if it was an oversight. If you decide it’s a design decision to keep it out, more blessings to you! Users who want to block, can always try to parse the text output.

Again, thanks for the tool!

I definitely see the case where users can opt-in to error on everything and acknowledging patch versions could break the CI, but I feel it's unlikely someone would want to put themselves to this, and an opt-in option could make it even easier to hit yourself in the foot.

I'll lean towards not supporting this for now then and will close this. Thanks for the discussion!