markdownlint-cli icon indicating copy to clipboard operation
markdownlint-cli copied to clipboard

Add support for fixing on stdin

Open technicalpickles opened this issue 3 years ago • 2 comments

This works by reading from stdin, and then applying fixes, and printing to the stdout. It will output the fixed file if --output is given.

The motivation for this is to be able to use it as a pipe, ie:

$ pbpaste | markdownlint --fix --stdin | pbcopy

technicalpickles avatar Jan 06 '21 17:01 technicalpickles

Thanks for the proposal! I've only looked briefly on my phone just now. One thing is that we'll need tests for this new code. Another is that it's not clear to me that results are output to STDERR in the new flow?

DavidAnson avatar Jan 06 '21 17:01 DavidAnson

Another is that it's not clear to me that results are output to STDERR in the new flow?

It does not, but that is something I was thinking 👍🏻

technicalpickles avatar Jan 06 '21 17:01 technicalpickles