breezy-mouse-20493
11/21/2023, 8:01 PMpants fmt :: goal, having enabled the pants.backend.python.lint.black backend, I added this to pants.toml
[black]
args = "--line-length 100 --exclude src/path/to/excluded/file.py"
yet it is still formatted. Any thoughts?curved-television-6568
11/21/2023, 8:31 PMskip_black option to not format particular sources:
https://www.pantsbuild.org/docs/reference-python_sources#codeskip_blackcode
See overrides if you have a target generator (such as python_sources) and want to skip a subset of files only (as well as __defaults__ if you want to apply the same to more targets at once):
https://www.pantsbuild.org/docs/targets#target-generation
https://www.pantsbuild.org/docs/targets#field-default-valuescurved-television-6568
11/21/2023, 8:33 PM# src/paht/to/excluded/BUILD
python_sources(
overrides={
"file.py": dict(skip_black=True)
}
)curved-television-6568
11/21/2023, 8:35 PM# src/path/to/excluded/BUILD
__defaults__({(python_sources, python_source): dict(skip_black=True)})breezy-mouse-20493
11/21/2023, 8:35 PM