[style] apply google python style guide (#4501)

This commit applies and enforces Google's python style for tests.
This commit is contained in:
Yakun Xu
2020-02-04 10:27:50 -08:00
committed by GitHub
parent 8368d440dd
commit 33808ebfba
501 changed files with 6674 additions and 5515 deletions
+7
View File
@@ -56,6 +56,10 @@ install_packages_apt()
# add clang-format for pretty
sudo apt-get -y install clang-format-6.0
# add yapf for pretty
python3 -m pip install yapf || echo 'Failed to install python code formatter yapf. Install it manually if you need.'
}
install_packages_opkg()
@@ -89,6 +93,9 @@ install_packages_brew()
brew install llvm@6
sudo ln -s "$(brew --prefix llvm@6)/bin/clang-format" /usr/local/bin/clang-format-6.0
}
# add yapf for pretty
python3 -m pip install yapf || echo 'Failed to install python code formatter yapf. Install it manually if you need.'
}
install_packages_source()
+1
View File
@@ -53,6 +53,7 @@ main()
{
trap at_exit INT TERM EXIT
make_pretty
python3 -m yapf --style google -ipr "${SRC_DIR}/tests" "${SRC_DIR}/tools"
}
main "$@"
-16
View File
@@ -1,16 +0,0 @@
[flake8]
# it's not a bug that we aren't using all of hacking, ignore:
# E203: White space before ':' (see #python#black#315).
# W503: Line break occurred before a binary operator (see #python#black#README.md).
ignore = E203, W503
# relax the length limitation for now.
max-line-length = 119
max-doc-length = 119
# Print the source code generating the error/warning in question.
show_source = True
show-source = True
# print the total number of errors.
count = True