be explicit about stdin for formatters (#987)

This commit is contained in:
Abouzar Parvan 2021-07-17 11:02:17 +04:30 committed by GitHub
parent ad373002d8
commit 3f4cf5f01d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 21 additions and 13 deletions

View file

@ -13,6 +13,7 @@ M.config = function()
formatter = { formatter = {
exe = "clang-format", exe = "clang-format",
args = {}, args = {},
stdin = true,
}, },
linters = { linters = {
"cppcheck", "cppcheck",
@ -33,7 +34,7 @@ M.format = function()
return { return {
exe = O.lang.clang.formatter.exe, exe = O.lang.clang.formatter.exe,
args = O.lang.clang.formatter.args, 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", cwd = vim.fn.expand "%:h:p",
} }
end, end,

View file

@ -6,6 +6,7 @@ M.config = function()
formatter = { formatter = {
exe = "dart", exe = "dart",
args = { "format" }, args = { "format" },
stdin = true,
}, },
} }
end end
@ -16,7 +17,7 @@ M.format = function()
return { return {
exe = O.lang.dart.formatter.exe, exe = O.lang.dart.formatter.exe,
args = O.lang.dart.formatter.args, args = O.lang.dart.formatter.args,
stdin = not (O.lang.dart.formatter.stdin ~= nil), stdin = O.lang.dart.formatter.stdin,
} }
end, end,
} }

View file

@ -16,7 +16,7 @@ M.format = function()
return { return {
exe = O.lang.elixir.formatter.exe, exe = O.lang.elixir.formatter.exe,
args = O.lang.elixir.formatter.args, args = O.lang.elixir.formatter.args,
stdin = not (O.lang.elixir.formatter.stdin ~= nil), stdin = O.lang.elixir.formatter.stdin,
} }
end, end,
} }

View file

@ -5,6 +5,7 @@ M.config = function()
formatter = { formatter = {
exe = "gofmt", exe = "gofmt",
args = {}, args = {},
stdin = true,
}, },
linters = { linters = {
"golangcilint", "golangcilint",
@ -19,7 +20,7 @@ M.format = function()
return { return {
exe = O.lang.go.formatter.exe, exe = O.lang.go.formatter.exe,
args = O.lang.go.formatter.args, args = O.lang.go.formatter.args,
stdin = not (O.lang.go.formatter.stdin ~= nil), stdin = O.lang.go.formatter.stdin,
} }
end, end,
} }

View file

@ -10,6 +10,7 @@ M.config = function()
formatter = { formatter = {
exe = "python", exe = "python",
args = { "-m", "json.tool" }, args = { "-m", "json.tool" },
stdin = true,
}, },
} }
end end
@ -20,7 +21,7 @@ M.format = function()
return { return {
exe = O.lang.json.formatter.exe, exe = O.lang.json.formatter.exe,
args = O.lang.json.formatter.args, args = O.lang.json.formatter.args,
stdin = not (O.lang.json.formatter.stdin ~= nil), stdin = O.lang.json.formatter.stdin,
} }
end, end,
} }

View file

@ -22,7 +22,7 @@ M.format = function()
return { return {
exe = O.lang.lua.formatter.exe, exe = O.lang.lua.formatter.exe,
args = O.lang.lua.formatter.args, args = O.lang.lua.formatter.args,
stdin = not (O.lang.lua.formatter.stdin ~= nil), stdin = O.lang.lua.formatter.stdin,
tempfile_prefix = ".formatter", tempfile_prefix = ".formatter",
} }
end, end,

View file

@ -30,7 +30,7 @@ M.format = function()
return { return {
exe = O.lang.php.formatter.exe, exe = O.lang.php.formatter.exe,
args = O.lang.php.formatter.args, args = O.lang.php.formatter.args,
stdin = not (O.lang.php.formatter.stdin ~= nil), stdin = O.lang.php.formatter.stdin,
tempfile_prefix = ".formatter", tempfile_prefix = ".formatter",
} }
end, end,

View file

@ -18,6 +18,7 @@ M.config = function()
formatter = { formatter = {
exe = "yapf", exe = "yapf",
args = {}, args = {},
stdin = true,
}, },
linters = { linters = {
"flake8", "flake8",
@ -33,7 +34,7 @@ M.format = function()
return { return {
exe = O.lang.python.formatter.exe, exe = O.lang.python.formatter.exe,
args = O.lang.python.formatter.args, args = O.lang.python.formatter.args,
stdin = not (O.lang.python.formatter.stdin ~= nil), stdin = O.lang.python.formatter.stdin,
} }
end, end,
} }

View file

@ -11,6 +11,7 @@ M.config = function()
formatter = { formatter = {
exe = "rufo", exe = "rufo",
args = { "-x" }, args = { "-x" },
stdin = true,
}, },
linters = { "ruby" }, linters = { "ruby" },
} }
@ -22,7 +23,7 @@ M.format = function()
return { return {
exe = O.lang.ruby.formatter.exe, exe = O.lang.ruby.formatter.exe,
args = O.lang.ruby.formatter.args, args = O.lang.ruby.formatter.args,
stdin = not (O.lang.ruby.formatter.stdin ~= nil), stdin = O.lang.ruby.formatter.stdin,
} }
end, end,
} }

View file

@ -11,6 +11,7 @@ M.config = function()
formatter = { formatter = {
exe = "rustfmt", exe = "rustfmt",
args = { "--emit=stdout", "--edition=2018" }, args = { "--emit=stdout", "--edition=2018" },
stdin = true,
}, },
linter = "", linter = "",
diagnostics = { diagnostics = {
@ -27,7 +28,7 @@ M.format = function()
return { return {
exe = O.lang.rust.formatter.exe, exe = O.lang.rust.formatter.exe,
args = O.lang.rust.formatter.args, args = O.lang.rust.formatter.args,
stdin = not (O.lang.rust.formatter.stdin ~= nil), stdin = O.lang.rust.formatter.stdin,
} }
end, end,
} }

View file

@ -25,7 +25,7 @@ M.format = function()
return { return {
exe = O.lang.sh.formatter.exe, exe = O.lang.sh.formatter.exe,
args = O.lang.sh.formatter.args, args = O.lang.sh.formatter.args,
stdin = not (O.lang.sh.formatter.stdin ~= nil), stdin = O.lang.sh.formatter.stdin,
tempfile_prefix = ".formatter", tempfile_prefix = ".formatter",
} }
end, end,

View file

@ -16,7 +16,7 @@ M.format = function()
return { return {
exe = O.lang.terraform.formatter.exe, exe = O.lang.terraform.formatter.exe,
args = O.lang.terraform.formatter.args, args = O.lang.terraform.formatter.args,
stdin = not (O.lang.terraform.formatter.stdin ~= nil), stdin = O.lang.terraform.formatter.stdin,
tempfile_prefix = ".formatter", tempfile_prefix = ".formatter",
} }
end, end,

View file

@ -5,6 +5,7 @@ M.config = function()
formatter = { formatter = {
exe = "prettier", exe = "prettier",
args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" }, args = { "--stdin-filepath", vim.api.nvim_buf_get_name(0), "--single-quote" },
stdin = true,
}, },
} }
end end
@ -15,7 +16,7 @@ M.format = function()
return { return {
exe = O.lang.yaml.formatter.exe, exe = O.lang.yaml.formatter.exe,
args = O.lang.yaml.formatter.args, args = O.lang.yaml.formatter.args,
stdin = not (O.lang.yaml.formatter.stdin ~= nil), stdin = O.lang.yaml.formatter.stdin,
} }
end, end,
} }