This is tricky when working on projects that use different formatting and coding styles (e.g. Drupal and Symfony), and on projects that haven't had code formatting run on them before and making a small change causes a large number of changes to be staged. I'll experiment with formatting code within a range, or toggling auto-formatting per project. Maybe something similar to what @wincent showed in https://youtu.be/ifA8iw42vwI.
23 lines
460 B
Lua
23 lines
460 B
Lua
local status_ok, null_ls = pcall(require, "null-ls")
|
|
if not status_ok then
|
|
return
|
|
end
|
|
|
|
local completion = null_ls.builtins.completion
|
|
local diagnostics = null_ls.builtins.diagnostics
|
|
local formatting = null_ls.builtins.formatting
|
|
|
|
null_ls.setup {
|
|
sources = {
|
|
formatting.prettier,
|
|
formatting.rustywind,
|
|
formatting.stylua,
|
|
|
|
diagnostics.eslint,
|
|
diagnostics.php,
|
|
diagnostics.phpcs,
|
|
diagnostics.phpstan,
|
|
|
|
completion.spell,
|
|
}
|
|
}
|