chore: Update yapf config and move it to sdk folder. (#6467)

* Update yapf config

* move style config to sdk folder

* link to style config file
This commit is contained in:
Chen Sun 2021-09-01 16:17:30 -07:00 committed by GitHub
parent 4572848cb6
commit a537a9c4a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 6 deletions

View File

@ -1,5 +0,0 @@
[style]
based_on_style = google
dedent_closing_brackets = true
coalesce_brackets = true
split_before_first_argument = true

View File

@ -24,7 +24,11 @@ again.
## Coding style
The Python part of the project will follow [Google Python style guide](http://google.github.io/styleguide/pyguide.html). We provide a [yapf](https://github.com/google/yapf) configuration file to help contributors auto-format their code to adopt the Google Python style. Also, it is encouraged to lint python docstrings by [docformatter](https://github.com/myint/docformatter).
### SDK
The SDK part of the project will follow [Google Python style guide](http://google.github.io/styleguide/pyguide.html). We use [YAPF](https://github.com/google/yapf) as the code formatter, and provide a [style configuration file](./sdk/.style.yapf) to help contributors auto-format their code to adopt the Google Python style. Also, it is encouraged to lint python docstrings by [docformatter](https://github.com/myint/docformatter).
### Frontend
The frontend part of the project uses [prettier](https://prettier.io/) for formatting, read [frontend/README.md#code-style](frontend/README.md#code-style) for more details.

5
sdk/.style.yapf Normal file
View File

@ -0,0 +1,5 @@
[style]
based_on_style = yapf
indent_width = 4
split_before_named_assigns = true
column_limit = 80