Open pawamoy opened 7 months ago
Thanks for the issue!
Yes, there should be lots of room for improvement here.
One issue is plugins that invoke a code formatter in a subprocess. I think they should pretty much always send the subprocess's stderr to subprocess.DEVNULL
as is done here, to not mix it up with mdformat's stderr, but I don't think there's any way mdformat can (or should) enforce that.
Apart from capturing everything at the file-descriptor level, using for example failprint, yep, no way to enforce that. I wouldn't particularly recommend using failprint as it's a potential can of worm for cross-platform compatibility :slightly_smiling_face:
Even if it's not enforced, it shouldn't be hard to convince plugin authors to update their code (or to send PRs, which I could do too) if there's documentation that goes in this direction.
Anyway, happy to help any way I can here!
Describe the bug
context When I format files, I get output lines that sometimes start with "Failed", sometimes "Warning:", and sometimes "error:". It can be a bit confusing.
expectation I would expect all warnings to start with "warning:", and errors associated to these warnings be appended at the end of the warnings, since these errors do not cause the program to stop (also see #434).
bug I'm actually not sure which lines come from plugin, from core, or why they differ.
Example:
problem I think we could gain at standardizing error messages a bit :slightly_smiling_face: Typically, adding the plugin name would make it clear to which repository/project we should report an issue when something doesn't work as expected.
Reproduce the bug
List your environment