Python Style Guide: Mention YAPF

107 views
Skip to first unread message

Andrew Grieve

unread,
Nov 27, 2018, 9:32:57 PM11/27/18
to pyt...@chromium.org

Propose adding:
 * Directories need to opt into pylint presumbit checks via:
   `input_api.canned_checks.RunPylint()`.
### YAPF
[YAPF](https://github.com/google/yapf) is a Python formatter that can be used via:
```sh
git cl format --python
```
Directories can opt into enforcing YAPF styling by adding `.style.yapf` file
with the following contents:
```
[style]
based_on_style = chromium
```
Entire files can be formatted (rather than just touched lines) via:
```sh
git cl format --python --full
```

Peter Wen

unread,
Nov 28, 2018, 2:35:38 PM11/28/18
to Andrew Grieve, pyt...@chromium.org
Looks good to me.

To clarify, without a .style.yapf file anywhere, what style does `git cl format --python` use?

Peter

--
You received this message because you are subscribed to the Google Groups "python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python+un...@chromium.org.
To post to this group, send email to pyt...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/python/CABiQX1Up58aFSeE2dMNySyfYJ%2B3MwyCz1TWbhnphXbVmhndwEw%40mail.gmail.com.

Andrew Grieve

unread,
Nov 28, 2018, 3:00:04 PM11/28/18
to Peter Wen, Andrew Grieve, pyt...@chromium.org
It uses the .style.yapf from depot_tools.
Reply all
Reply to author
Forward
0 new messages