google / google/yapf

unable to format code with yapf

Open
#1,035 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
14k
Forks
904
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.