Commit aa485a7
Move YAPF style setting to a project-wide
Scripts and workflows that run `yapf` currently each add the option
`--style=google` to the invocation of `yapf`. To follow best practices,
this PR adds a `.style.yapf` configuration file at the top level of the
project to set the style, and removes the flag from where it was added
on the command line explicitly.
The use of a config file has the following benefits:
- It lets tools like IDEs discover the setting automatically.
- It reduces the chances that developers will forget to add the flag
when they run `yapf` directly on the command line for quick checks, or
write new scripts that use `yapf`.
- It communicates intentions more clearly to new contributors.
Removing the flag from the scripts is not strictly necessary (everything
will work the same if there is both a config file and the flag is passed
to `yapf`). However, if a config file is used, it's better for
maintainability and consistency to also remove the flag from individual
invocations.
Note: the CI will fail the lint check until PR #1047 is merged.
---------
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>.style.yapf file (#1038)1 parent 2d046b9 commit aa485a7
3 files changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
| 17 | + | |
19 | 18 | | |
20 | 19 | | |
21 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments