aboutsummaryrefslogtreecommitdiff
path: root/.style.yapf
diff options
context:
space:
mode:
authorGeorge Burgess IV <gbiv@google.com>2019-01-02 11:41:37 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-04 02:09:05 -0800
commit0e74b9bf195b55935e81f79ffcd1382a9a678715 (patch)
tree364079c27c8ce760f3203bd4dbe328f4147c0983 /.style.yapf
parent2639395908b32e4560b3b9a5290db08ae819f8e9 (diff)
downloadtoolchain-utils-0e74b9bf195b55935e81f79ffcd1382a9a678715.tar.gz
toolchain-utils: add a top-level `yapf` file
yapf is a Python autoformatter, much like how clang-tidy is an autoformatter for c/c++. It's available by default in the chroot, and appears to be in use by our autotest friends. I ran `yapf -i *.py`, and it only suggested a handful of changes from our current style here. The only one I really noticed was that it preferred 'foo %s' % (really_long_variable_name_one, really_long_variable_name_two) over 'foo %s' % (really_long_variable_name_one, really_long_variable_name_two) ...Which I think we do in some files, anyway. This file magically applies to all `yapf` invocations inside of toolchain-utils, so it's not something that people need to worry about. Simply run `yapf -i file.py`, and it'll be automatically formatted to conform to Chromium's style guidelines, which we try to follow here. BUG=chromium:918755 TEST=`yapf *.py` left files mostly untouched. `cros lint` is just as (un)happy after the format as it was before. Change-Id: Ie09694d8466b398ca07f5c8544597c9a28c7abfe Reviewed-on: https://chromium-review.googlesource.com/1392445 Commit-Ready: George Burgess <gbiv@chromium.org> Tested-by: George Burgess <gbiv@chromium.org> Reviewed-by: Luis Lozano <llozano@chromium.org>
Diffstat (limited to '.style.yapf')
-rw-r--r--.style.yapf2
1 files changed, 2 insertions, 0 deletions
diff --git a/.style.yapf b/.style.yapf
new file mode 100644
index 00000000..de0c6a70
--- /dev/null
+++ b/.style.yapf
@@ -0,0 +1,2 @@
+[style]
+based_on_style = chromium