diff --git a/.style.yapf b/.style.yapf new file mode 100644 index 000000000..0e9640c29 --- /dev/null +++ b/.style.yapf @@ -0,0 +1,2 @@ +[style] +based_on_style = google diff --git a/scripts/format_all.sh b/scripts/format_all.sh index 121488c79..b470d7f02 100755 --- a/scripts/format_all.sh +++ b/scripts/format_all.sh @@ -14,8 +14,7 @@ # limitations under the License. # ============================================================================== echo "Doing python language formatting..." -python3 -m yapf --style=google --in-place --recursive --parallel \ - ./benchmarks ./scripts ./tensorflow_quantum +python3 -m yapf --in-place --recursive ./benchmarks ./tensorflow_quantum ./scripts echo -e "Done! \nDoing notebook formatting..." python3 ./scripts/format_ipynb.py echo -e "Done! \nDoing C++ formatting..." diff --git a/scripts/format_check.sh b/scripts/format_check.sh index 9a1bf1fd4..0512bca25 100755 --- a/scripts/format_check.sh +++ b/scripts/format_check.sh @@ -72,7 +72,7 @@ for changed_file in ${changed_files}; do ) if [[ "${changed_line_ranges}" != "--lines=0-0 " ]]; then # Do the formatting. - results=$(yapf --style=google --diff "${changed_file}" ${changed_line_ranges}) + results=$(python3 -m yapf --diff "${changed_file}" ${changed_line_ranges}) # Print colorized error messages. if [ ! -z "${results}" ]; then