Hi, i noticed there was a conversation recently ab...
# general
a
Hi, i noticed there was a conversation recently about opting out of black - can anyone point me to the docs for doing that ?
c
a
ah, i meant for BUILD files
c
There’s also
Copy code
$ ./pants help black

`black` subsystem options
-------------------------

The Black Python code formatter (<https://black.readthedocs.io/>).
 
Config section: [black]
 
  --[no-]black-skip
  PANTS_BLACK_SKIP
  skip
      default: False
      current value: False
      Don't use Black when running `./pants fmt` and `./pants lint`
and
Copy code
$ ./pants help python_library

python_library
--------------

Python source code.
[...]

skip_black
    type: bool
    default: False
    If true, don't run Black on this target's code.

...
ah, i meant for BUILD files
Ah, right..
a
but, thanks anway, i want to opt out everywhere !
h
The update-build-files goal still needs to be documented. Run ./pants help update-build-files
a
thanks...
h
For your own code, black should be opted out of unless you add the backend to pants.toml. It's only BUILD files where you have to opt out
a
yep, i see, it hasnt run on anything apart from build files so far
c
Eric beat me to it…
Copy code
$ ./pants help update-build-files
[...]
  --[no-]update-build-files-fmt
  PANTS_UPDATE_BUILD_FILES_FMT
  fmt
      default: True
      current value: True
      Format BUILD files using Black.
      
      Set `[black].args`, `[black].config`, and `[black].config_discovery` to change Black's behavior. Set `[black].interpreter_constraints` and
      `[python].interpreter_search_path` to change which interpreter is used to run Black.
a
so after reading this i added...
Copy code
[update-build-files]
fmt = False
but i still see it running black - am i misreading something ?
h
Hm you are..? Seeing it run on build files or your own code?
a
added above, then reran
pants update-build-files
and saw lines like...
Copy code
Updated envoy.distribution.repo/BUILD:
  - Format with Black
actually, nm
i did a
git checkout
in between and caned my toml file change - apologies for noise
h
Cool, glad it's working. Also feel free to share feedback on that goal! It's new to 2.8. Hoping to add more deprecation fixers in the future