This repository has been archived by the owner on Aug 12, 2023. It is now read-only.
null-ls black
not recognizing pyproject.toml
config
#1377
Unanswered
shamindras
asked this question in
Q&A
Replies: 1 comment 3 replies
-
As an update I changed the lines: formatting.black,
formatting.isort, to the following: -- python
formatting.black.with({
condition = function(utils)
return utils.root_has_file('pyproject.toml') -- change file extension if you use something else
end,
}),
formatting.isort.with({
condition = function(utils)
return utils.root_has_file('pyproject.toml') -- change file extension if you use something else
end,
}), however both Any ideas what I may be doing wrong here? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Thank you for creating this great package. I'm really enjoying configuring my python
nvim
setup with it.I'm running into an issue with my
black
formatting config per here. This indeed does work in that it formats python files (on save) using the default black options. However, I wantblack
to use my project specific options, as defined by thepyproject.toml
in the root directory.As it can be seen I've set the line formatting to be
79
characters inpyproject.toml
, butblack
is formatting to80
in my document. This throws an LSP warning, as per the screenshot below:Could anyone please assist in helping configure
black
to use thepyproject.toml
withnull-ls
?Beta Was this translation helpful? Give feedback.
All reactions