Closed frothedoatmilk closed 5 months ago
Because it's common for linters to either take a filename, or use input from stdin, but not both. In some cases the stdin option also requires -
as filename. The defaults model the common case but can't capture all variants.
Hi! I'm trying to write a config for haml-lint and I'm seeing some interesting patterns in how
append_fname
is used in the linters. The way I imaginedappend_fname
would work is something like:opts = { ..., append_fname = true, ...}
=><command> <args> <filename>
opts = { ..., append_fname = false, ...}
=><command> <args>
But I'm seeing there is some additional logic, where the file name only gets appended if you're not trying to use stdin...but if you need to use the file name in a stdin linter, you have to do some trickery and use
vim.api.nvim_buf_get_name(0)
. This occurs in a number of the linters in the repo at this point. Is there a reason why theappend_fname
doesn't just default to true across the board?