Configure YAPF with PEP8 styling to ignore whitespace around equals operator

284 Views Asked by At

I'm using YAPF with the PEP8 style, and I'm trying to ignore whenever there's whitespace around the equals '=' operator, for example:

environment: Optional[Dict[str, str]] = None

Is formatted to:

environment: Optional[Dict[str, str]]=None

There isn't a YAPF knob (https://github.com/google/yapf#knobs) which allows me to change this configuration.

Is there a way to make YAPF use some custom PEP8 configuration, or change this setting?

1

There are 1 best solutions below

1
On

add the following lines to .pyproject.toml

[yapf]
style = pep8
spaces_around_eq = no