Closed AnshUjlayan closed 3 months ago
Typically you would want to set this on a per-project basis using a config file, e.g. putting the options in pyproject.toml.
If you instead want to configure it globally, you can pass in the --line-length
argument to the formatter. I have no idea where you got the syntax you are using, but that is not the correct way to customize the arguments for a formatter. You will want:
conform.setup({
formatters_by_ft = {
python = { "isort", "black" },
},
formatters = {
black = {
prepend_args = { "--line-length", "79" },
}
},
})
It worked! Thank you so much :)
I can’t specify the line length in for my black formatter. isort and black both are working, but i don’t know how to set blacks arguments to format to 79 chars instead of 88.
source code for reference. https://github.com/AnshUjlayan/nvim