bug: isort: error: argument --le/--line-ending: expected one argument
Neovim version (nvim -v)
0.9.5
Operating system/version
Windows 10
Add the debug logs
- [X] I have set
log_level = vim.log.levels.DEBUGand pasted the log contents below.
Log file
Describe the bug
When applying isort formatting, an error occurs.
What is the severity of this bug?
tolerable (can work around it)
Steps To Reproduce
When formatting any file that contains imports. This error occurs.
Expected Behavior
Here is the config. When
Minimal example file
No response
Minimal init.lua
-- DO NOT change the paths and don't remove the colorscheme
local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"--single-branch",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
"folke/tokyonight.nvim",
{
"stevearc/conform.nvim",
config = function()
require("conform").setup({
log_level = vim.log.levels.DEBUG,
-- add your config here
})
end,
},
-- add any other plugins here
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.cmd.colorscheme("tokyonight")
-- add anything else here
Additional context
Has anyone encountered this and found a solution?
I encountered an identical bug, any solution?
Unfortunately no. I will solve this problem later. If you find any solution please write.
Found the cause of the failure. Black and Isort rule each other, and this leads to conflict. Therefore Isort is disabled. This argument can be corrected. I just haven't figured out how yet. You need to specify arguments in conform.nvim.🙄
For now I've been able to get around the conflict by enabling the Isort and black settings. Although the line ending error remained in the ConformInfo manual. But everything works and there are no conflicts. You can also try using { "--profile", "black" } arguments. Now isort is not disabled. Conform works stably.
I got the identical error.
Fixed it by re-rule the isort command (add one - to args).
A little shorter.
formatters = {
isort = {
command = "isort",
args = {
"-",
},
},
},