Generators: display a message when no documentation is available - #1450
Generators: display a message when no documentation is available#1450lazerg wants to merge 1 commit into
Conversation
|
Hey @jrfnl, would you mind taking a look when you get a chance~ |
jrfnl
left a comment
There was a problem hiding this comment.
@lazerg Thanks for this PR. I've verified the implementation and it all looks good to me.
The message is sent to
STDERRso it doesn't end up in redirected output such asphpcs --generator=HTML > docs.html. I kept it to a single summary line and left the exit code unchanged, but I'm happy to switch to a per-sniff message or a different stream if you'd prefer.
I agree with the choices you made. If needs be, we can always iterate on this.
Considering this is a new message for the CLI, I've earmarked this PR for the next minor release 4.1.0.
Thank you for contributing!
One more general remark: the commit messages for your PRs which I've looked at so far where very minimal (title only), while the PR description on the GH website contained all the reasoning for what is being fixed & why & why this way.
I'd like to ask you to include that information in the commit messages going forward for reasons as explained in the CONTRIBUTING guide:
Being wordy in the commit message is not a bad thing. It is greatly preferable to have the details about a fix in the commit message over just having those details in the PR description. Code hosting platforms come and go (think: SourceForge, PEAR), commit messages are here to stay, even if the code base would move to another platform at some point in the future.
|
Note to self: manually verified the code coverage as this was pulled while Coveralls had an outage. All good: https://coveralls.io/builds/80350495 |
Description
When
--generatoris used but none of the targeted sniffs ship a documentation file, all three generators (Text,HTMLandMarkdown) currently produce no output at all, which makes it look like the command failed or that the arguments were wrong. Following the discussion with @jrfnl referenced in the issue, this makes the generators print a short message toSTDERRin that case instead of staying silent.The message is sent to
STDERRso it doesn't end up in redirected output such asphpcs --generator=HTML > docs.html. I kept it to a single summary line and left the exit code unchanged, but I'm happy to switch to a per-sniff message or a different stream if you'd prefer.Suggested changelog entry
Added: the
Text,HTMLandMarkdowndocumentation generators now print a message toSTDERRwhen no documentation is available for the requested sniffs, instead of producing no output at all.Related issues/external references
Fixes #1410
Types of changes
PR checklist