Hi there. We use `exclude` arg in Black to exclude...
# general
Hi there. We use
arg in Black to exclude some dirs from black. However, it seems the exclude flag is not working with
by using he same config file pyproject.toml. Anyone having this issue as well?
This is probably because Pants tells Black to explicitly run on every file. I think there was a reason we had to do it that that way, but I can't remember why and it might be possible to stop doing so that this just works Have you seen the skip black field? https://www.pantsbuild.org/docs/python-linters-and-formatters#running-only-certain-formatters-or-linters
👍 1
oh thanks. I will try that field
❤️ 1
@hundreds-father-404 the skip files in python_sources seems work. But I am wondering if there is a quick way to skip an entire folder including sub-folders. Assuming the following structure, where I want to skip for everything under A and A/B
Copy code
— A
  - B
It seems I have to use skip fields in both BUILD files A and B. Am I right? is there a quick/ alliterative way?
i guess i can use pants_ignore?
Yeah, unfortunately this is not as easy to set on multiple directories as it should be. For now you have to set it in each build file. https://github.com/pantsbuild/pants/issues/13767 suggest some future improvements we are considering You should only use pants ignore if you do not want pants to work with the code at all. It will be like the code does not exist to pants