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

[FEAT] stdin support

Open xudyang1 opened this issue 1 year ago • 2 comments

markdownlint-cli supports read from stdin, and markdownlint itself supports --stdin option to parse stdin input. Is it possible to make markdownlint-cli2 support stdin?

xudyang1 avatar Sep 19 '24 01:09 xudyang1

I'll look into whether it is straightforward to do this by supporting - as with cat and tar. but if it is not, I will leave things as they are and recommend those other tools for this scenario.

FYI, I've asked before, and have not heard a particularly compelling scenario for why standard input was necessary versus creating and using a temporary file.

DavidAnson avatar Sep 19 '24 16:09 DavidAnson

I'll look into whether it is straightforward to do this by supporting - as with cat and tar. but if it is not, I will leave things as they are and recommend those other tools for this scenario.

FYI, I've asked before, and have not heard a particularly compelling scenario for why standard input was necessary versus creating and using a temporary file.

I would not say standard input is necessary for linting, but it does help editors like neovim to update diagnostics after changing the active buffer (without saving it to disk). Currently, nvim-lint uses markdownlint and markdownlint-cli2 without stdin support, and because of that, users have to save the buffer to see diagnostics update. I am also trying to customize my configuration to make markdownlint in nvim-lint work from standard input, in that case, I would like to stick with markdownlint if it works well.

Anyway, thank you for developing an amazing linting/formatting tool for markdown!

xudyang1 avatar Sep 19 '24 20:09 xudyang1