mirror of
https://github.com/espressif/openthread.git
synced 2026-08-19 17:09:51 +00:00
[style] apply google python style guide (#4501)
This commit applies and enforces Google's python style for tests.
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user