-
Notifications
You must be signed in to change notification settings - Fork 778
Meta-question: are you open to more pull reqs like https://github.com/jose-elias-alvarez/null-ls.nvim/pull/1313? #1337
Comments
In short: yes, I think this is a good approach. As #1313 showed, though, there are definitely a few potential issues we have to look out for:
That means if we're going to do this, we'll have to proceed carefully. |
@jose-elias-alvarez fair enough, and all good points. If and when I open pull reqs for this, I'll do it on a formatter-by-formatter basis so they can be discussed individually. FYI, here's the editorconfig docs: https://github.com/neovim/neovim/blob/master/runtime/doc/editorconfig.txt |
So I've been doing a bit more investigating/thinking. It seems that quite at least two of the formatters I've looked at so far (shfmt, prettier...) support a model like this where settings are evaluated in priority like this ("winner" at the top).
What this means is that if a user does have an editorconfig file, but they are using NeoVim pre-0.9 without an editorconfig plugin, the situation may get worse with the new logic I'm talking about using here, because the values will instead come from the buffer settings, which may be wrong unless something like However, with the default behavior for NeoVim 0.9 onwards w.r.t editorconfig (as long as the user doesn't turn it off), this would not be a problem as ultimately the settings will still come from editorconfig, but via NeoVim. What this new behaviour does mean is that for people who don't use editorconfig, but are still using sleuth, or are editing a standalone file somewhere, running For me, that's the right balance, but I wanted to explore this with you before moving forward. |
@gpanders you might be tangentially interested in this since it's related to the new editorconfig support. |
Uh oh!
There was an error while loading. Please reload this page.
Issues
Feature description
I note that in #1313 you added appropriate CLI options for denols for
textwidth
andshiftwidth
. IMHO for these and other settings this is exactly the correct approach to take. With plugins like vim-sleuth - which I use - and the forthcoming built-in editorconfig support in NeoVim 0.9 - I think it's reasonable to assume that users should have correctly settextwidth
,shiftwidth
,expandtab
, etc. most of the time (even if they don't, the proposal I'm going on to make would not make the situation any worse, I think).In my personal
null-ls
configuration, I make fairly heavy use of this, setting appropriate CLI args forblack
,latexindent
,prettier
and others (please feel free to take a look, I think the code is fairly readable).Would you be open to more pull requests to incorporate these kind of 'default options' into the default setup for null-ls formatters? If so, would you want one per formatter?
Help
Yes
Implementation help
No response
The text was updated successfully, but these errors were encountered: