Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Commit

Permalink
[clang-format] change to v9.0.0 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwhui committed Dec 12, 2020
1 parent 0856d57 commit 08e3a14
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ This will open up a text editor where you can specify which commits to squash.

#### Coding Conventions and Style

OpenThread RTOS 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 `script/make-pretty` and `script/make-pretty check` to automatically reformat code and check for code-style compliance, respectively. OpenThread RTOS currently requires [clang-format v10.0.0](http://releases.llvm.org/download.html#10.0.0) for C/C++ and [yapf](https://github.com/google/yapf) for Python.
OpenThread RTOS 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 `script/make-pretty` and `script/make-pretty check` to automatically reformat code and check for code-style compliance, respectively. OpenThread RTOS currently requires [clang-format v9.0.0](http://releases.llvm.org/download.html#9.0.0) for C/C++ and [yapf](https://github.com/google/yapf) for Python.

As part of the cleanup process, you should also run `script/make-pretty check` to ensure that your code passes the baseline code style checks.

Expand Down
2 changes: 1 addition & 1 deletion STYLE_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

- OpenThread uses `script/make-pretty` to reformat code and enforce code format and style. `script/make-pretty check` is included in OpenThread's continuous integration and must pass before a pull request is merged.

- `script/make-pretty` requires [clang-format v10.0.0](http://releases.llvm.org/download.html#10.0.0) for C/C++ and [yapf](https://github.com/google/yapf) for Python.
- `script/make-pretty` requires [clang-format v9.0.0](http://releases.llvm.org/download.html#9.0.0) for C/C++ and [yapf](https://github.com/google/yapf) for Python.

### File Names

Expand Down
10 changes: 5 additions & 5 deletions script/clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# POSSIBILITY OF SUCH DAMAGE.
#

CLANG_FORMAT_VERSION="clang-format version 10.0"
CLANG_FORMAT_VERSION="clang-format version 9.0"

die()
{
Expand All @@ -39,18 +39,18 @@ die()
# expand_aliases shell option is set using shopt.
shopt -s expand_aliases

if command -v clang-format-10 >/dev/null; then
alias clang-format=clang-format-10
if command -v clang-format-9 >/dev/null; then
alias clang-format=clang-format-9
elif command -v clang-format >/dev/null; then
case "$(clang-format --version)" in
"$CLANG_FORMAT_VERSION"*) ;;

*)
die "$(clang-format --version); clang-format 10.0 required"
die "$(clang-format --version); clang-format 9.0 required"
;;
esac
else
die "clang-format 10.0 required"
die "clang-format 9.0 required"
fi

clang-format "$@" || die
Expand Down
3 changes: 2 additions & 1 deletion script/clang-format-check
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@

set -euo pipefail

die() {
die()
{
echo " *** ERROR: $*"
exit 1
}
Expand Down

0 comments on commit 08e3a14

Please sign in to comment.