diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 0000000000..de72b98c2c --- /dev/null +++ b/.style.yapf @@ -0,0 +1,3 @@ +[style] +based_on_style = pep8 +indent_width = 2 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e1410af4f9..102614d436 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -190,7 +190,7 @@ Below are some tips that might be useful and improve the development experience. ``` pip install yapf - yapf log_parser.py -i --style='{based_on_style: pep8, indent_width: 2}' + yapf log_parser.py -i' ``` * Add a git hook to check for code style etc. prior to creating a pull request: diff --git a/tensorflow/lite/micro/tools/make/pigweed.patch b/tensorflow/lite/micro/tools/make/pigweed.patch index d1e29304e7..9aa2044e30 100644 --- a/tensorflow/lite/micro/tools/make/pigweed.patch +++ b/tensorflow/lite/micro/tools/make/pigweed.patch @@ -14,15 +14,6 @@ diff --git a/pw_presubmit/py/pw_presubmit/format_code.py b/pw_presubmit/py/pw_pr index 19d09546..c1ff6b5a 100755 --- a/pw_presubmit/py/pw_presubmit/format_code.py +++ b/pw_presubmit/py/pw_presubmit/format_code.py -@@ -142,7 +142,7 @@ def fix_go_format(files: Iterable[Path]) -> None: - - - def _yapf(*args, **kwargs) -> subprocess.CompletedProcess: -- return log_run(['python', '-m', 'yapf', '--parallel', *args], -+ return log_run(['python', '-m', 'yapf', '--style', '{based_on_style:pep8,indent_width:2}', '--parallel', *args], - capture_output=True, - **kwargs) - @@ -229,11 +229,6 @@ def print_format_check(errors: Dict[Path, str], except ValueError: return Path(path).resolve()