Make git-cl not need --python to format Python
Turns out we don't need to type git cl format --python every time. If we
add a .style.yapf file, it will do it by default.
Quoth `git cl format --help`:
> If neither --python or --no-python are set, python files that have a
> .style.yapf file in an ancestor directory will be formatted.
Remove check_python=True from PRESUBMIT.py to make it do the same - and
suggest `git cl format` instead of `git cl format --python` when running
presubmit checks (during `git cl upload` or `git cl presubmit`).
Quoth `presubmit_canned_checks.py`:
> Explicitly setting check_python to will enable/disable python formatting
> on all files. Leaving it as None will enable checking patch formatting
> on files that have a .style.yapf file in a parent directory.
Verified on at least one Python file this doesn't change the formatting
results, so it seems to be the same as the default configuration.
Bug: none
Change-Id: Ia22f783b30181bed54933c732749a9837837bac2
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/239455
Auto-Submit: Kai Ninomiya <kainino@chromium.org>
Reviewed-by: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Kai Ninomiya <kainino@chromium.org>
diff --git a/.style.yapf b/.style.yapf
new file mode 100644
index 0000000..557fa7b
--- /dev/null
+++ b/.style.yapf
@@ -0,0 +1,2 @@
+[style]
+based_on_style = pep8
diff --git a/PRESUBMIT.py b/PRESUBMIT.py
index ad206f1..a640585 100644
--- a/PRESUBMIT.py
+++ b/PRESUBMIT.py
@@ -175,7 +175,6 @@
input_api.canned_checks.CheckPatchFormatted(
input_api,
output_api,
- check_python=True,
result_factory=result_factory))
results.extend(
input_api.canned_checks.CheckGNFormatted(input_api, output_api))