[style] change to clang-format-6.0 (#3222)

This commit is contained in:
Jonathan Hui
2018-10-19 06:56:30 -07:00
parent dcc9b7e249
commit 5e4be05907
5 changed files with 11 additions and 10 deletions

View File

@ -84,9 +84,10 @@ matrix:
addons:
apt:
sources:
- llvm-toolchain-trusty-5.0
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-5.0
- clang-format-6.0
- env: BUILD_TARGET="scan-build" CC="clang-6.0" CXX="clang++-6.0"
os: linux
addons:

View File

@ -112,7 +112,7 @@ This will open up a text editor where you can specify which commits to squash.
#### Coding Conventions and Style
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1) for `make pretty` and `make pretty-check`.
OpenThread uses and enforces the [OpenThread Coding Conventions and Style](STYLE_GUIDE.md) on all code, except for code located in [third_party](third_party). Use the `make pretty` and `make pretty-check` targets to automatically reformat code and check for code-style compliance, respectively. OpenThread currently requires [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0) for `make pretty` and `make pretty-check`.
As part of the cleanup process, you should also run `make pretty-check` to ensure that your code passes the baseline code style checks.

View File

@ -114,7 +114,7 @@
- OpenThread uses the `make pretty` build target to reformat code and enforce code format and style. The `make pretty-check` build target is included in OpenThread's continuous integration and must pass before a pull request is merged.
- The `make pretty` and `make pretty-check` build targets require [clang-format v5.0.1](http://releases.llvm.org/download.html#5.0.1).
- The `make pretty` and `make pretty-check` build targets require [clang-format v6.0.0](http://releases.llvm.org/download.html#6.0.0).
### File Names
- File names should match the names and types of what is described in the file. If a file contains many declarations and definitions, the author should choose the one that predominantly describes or that makes the most sense.

View File

@ -49,7 +49,7 @@ install_packages_apt()
sudo apt-get install gcc-arm-embedded
# add clang-format for pretty
sudo apt-get install clang-format-5.0
sudo apt-get install clang-format-6.0
}
install_packages_opkg()

View File

@ -27,25 +27,25 @@
# POSSIBILITY OF SUCH DAMAGE.
#
CLANG_FORMAT_VERSION="clang-format version 5.0"
CLANG_FORMAT_VERSION="clang-format version 6.0"
die() {
echo " *** ERROR: " $*
exit 1
}
if which clang-format-5.0 > /dev/null; then
alias clang-format=clang-format-5.0
if which clang-format-6.0 > /dev/null; then
alias clang-format=clang-format-6.0
elif which clang-format > /dev/null; then
case "$(clang-format --version)" in
"$CLANG_FORMAT_VERSION"*)
;;
*)
die "clang-format 5.0 required"
die "clang-format 6.0 required"
;;
esac
else
die "clang-format 5.0 required"
die "clang-format 6.0 required"
fi
clang-format $@