yapf icon indicating copy to clipboard operation
yapf copied to clipboard

unable to format code with yapf

Open wrench1815 opened this issue 3 years ago • 1 comments
trafficstars

I'm unable to format code with yapf. My setup is using poetry and I use .style.yapf file to handle config for yapf. With VS Code format on save functionality, it is not formatting code. Using CLI, it keeps giving me yapf: toml package is needed for using pyproject.toml as a configuration file if I use .style.yapf and Invalid TOML file /home/wrench1815/Documents/git/vis-dash/vd-back/pyproject.toml: Unexpected character: 'p' at line 16 col 17 if I use pyproject.toml to handle the config. Also, I tried with yapf and yapf[pyproject]. With yapf[pyproject], the extra does not install TOML although, as in #964, it is supposed to install it.

Yes, I'm using yapf from my env, I tried using with poetry run yapf and yapf both. But the errors persist.

If only TOML is manually installed, yapf works unless it won't.

wrench1815 avatar Oct 27 '22 12:10 wrench1815

Attempt to repro with version >=0.33.0

Spitfire1900 avatar Jun 16 '23 18:06 Spitfire1900