mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-07-21 03:04:31 +02:00
be explicit about stdin for formatters (#987)
This commit is contained in:
parent
ad373002d8
commit
3f4cf5f01d
13 changed files with 21 additions and 13 deletions
|
@ -13,6 +13,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "clang-format",
|
||||
args = {},
|
||||
stdin = true,
|
||||
},
|
||||
linters = {
|
||||
"cppcheck",
|
||||
|
@ -33,7 +34,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.clang.formatter.exe,
|
||||
args = O.lang.clang.formatter.args,
|
||||
stdin = not (O.lang.clang.formatter.stdin ~= nil),
|
||||
stdin = O.lang.clang.formatter.stdin,
|
||||
cwd = vim.fn.expand "%:h:p",
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -6,6 +6,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "dart",
|
||||
args = { "format" },
|
||||
stdin = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -16,7 +17,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.dart.formatter.exe,
|
||||
args = O.lang.dart.formatter.args,
|
||||
stdin = not (O.lang.dart.formatter.stdin ~= nil),
|
||||
stdin = O.lang.dart.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.elixir.formatter.exe,
|
||||
args = O.lang.elixir.formatter.args,
|
||||
stdin = not (O.lang.elixir.formatter.stdin ~= nil),
|
||||
stdin = O.lang.elixir.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "gofmt",
|
||||
args = {},
|
||||
stdin = true,
|
||||
},
|
||||
linters = {
|
||||
"golangcilint",
|
||||
|
@ -19,7 +20,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.go.formatter.exe,
|
||||
args = O.lang.go.formatter.args,
|
||||
stdin = not (O.lang.go.formatter.stdin ~= nil),
|
||||
stdin = O.lang.go.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "python",
|
||||
args = { "-m", "json.tool" },
|
||||
stdin = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -20,7 +21,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.json.formatter.exe,
|
||||
args = O.lang.json.formatter.args,
|
||||
stdin = not (O.lang.json.formatter.stdin ~= nil),
|
||||
stdin = O.lang.json.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.lua.formatter.exe,
|
||||
args = O.lang.lua.formatter.args,
|
||||
stdin = not (O.lang.lua.formatter.stdin ~= nil),
|
||||
stdin = O.lang.lua.formatter.stdin,
|
||||
tempfile_prefix = ".formatter",
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -30,7 +30,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.php.formatter.exe,
|
||||
args = O.lang.php.formatter.args,
|
||||
stdin = not (O.lang.php.formatter.stdin ~= nil),
|
||||
stdin = O.lang.php.formatter.stdin,
|
||||
tempfile_prefix = ".formatter",
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -18,6 +18,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "yapf",
|
||||
args = {},
|
||||
stdin = true,
|
||||
},
|
||||
linters = {
|
||||
"flake8",
|
||||
|
@ -33,7 +34,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.python.formatter.exe,
|
||||
args = O.lang.python.formatter.args,
|
||||
stdin = not (O.lang.python.formatter.stdin ~= nil),
|
||||
stdin = O.lang.python.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "rufo",
|
||||
args = { "-x" },
|
||||
stdin = true,
|
||||
},
|
||||
linters = { "ruby" },
|
||||
}
|
||||
|
@ -22,7 +23,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.ruby.formatter.exe,
|
||||
args = O.lang.ruby.formatter.args,
|
||||
stdin = not (O.lang.ruby.formatter.stdin ~= nil),
|
||||
stdin = O.lang.ruby.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "rustfmt",
|
||||
args = { "--emit=stdout", "--edition=2018" },
|
||||
stdin = true,
|
||||
},
|
||||
linter = "",
|
||||
diagnostics = {
|
||||
|
@ -27,7 +28,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.rust.formatter.exe,
|
||||
args = O.lang.rust.formatter.args,
|
||||
stdin = not (O.lang.rust.formatter.stdin ~= nil),
|
||||
stdin = O.lang.rust.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.sh.formatter.exe,
|
||||
args = O.lang.sh.formatter.args,
|
||||
stdin = not (O.lang.sh.formatter.stdin ~= nil),
|
||||
stdin = O.lang.sh.formatter.stdin,
|
||||
tempfile_prefix = ".formatter",
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -16,7 +16,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.terraform.formatter.exe,
|
||||
args = O.lang.terraform.formatter.args,
|
||||
stdin = not (O.lang.terraform.formatter.stdin ~= nil),
|
||||
stdin = O.lang.terraform.formatter.stdin,
|
||||
tempfile_prefix = ".formatter",
|
||||
}
|
||||
end,
|
||||
|
|
|
@ -5,6 +5,7 @@ M.config = function()
|
|||
formatter = {
|
||||
exe = "prettier",
|
||||
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
|
||||
stdin = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
|
@ -15,7 +16,7 @@ M.format = function()
|
|||
return {
|
||||
exe = O.lang.yaml.formatter.exe,
|
||||
args = O.lang.yaml.formatter.args,
|
||||
stdin = not (O.lang.yaml.formatter.stdin ~= nil),
|
||||
stdin = O.lang.yaml.formatter.stdin,
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue