From 33d5dd9bdd99baf7a0005be36ca468977fdef46d Mon Sep 17 00:00:00 2001 From: Wouter van Oortmerssen Date: Thu, 7 Nov 2019 14:35:42 -0800 Subject: [PATCH] Improved pull request & clang-format instructions. Change-Id: Ia439bcc61bac5788792244d10e573b1fba54b347 --- .github/PULL_REQUEST_TEMPLATE.md | 6 +++++- src/clang-format-all.sh | 6 ++++++ src/clang-format-git.sh | 6 ++++++ src/clang-format.sh | 2 -- 4 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 src/clang-format-all.sh create mode 100644 src/clang-format-git.sh delete mode 100644 src/clang-format.sh diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 8199465..4cbb292 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,6 +1,8 @@ Thank you for submitting a PR! -Please make sure you include the names of the affected language(s) in your PR title. +Please delete this standard text once you've created your own description. + +Make sure you include the names of the affected language(s) in your PR title. This helps us get the correct maintainers to look at your issue. If you make changes to any of the code generators, be sure to run @@ -11,6 +13,8 @@ If your PR includes C++ code, please adhere to the Google C++ Style Guide, and don't forget we try to support older compilers (e.g. VS2010, GCC 4.6.3), so only some C++11 support is available. +For any C++ changes, please make sure to run `sh src/clang-format-git.sh` + Include other details as appropriate. Thanks! diff --git a/src/clang-format-all.sh b/src/clang-format-all.sh new file mode 100644 index 0000000..3fd9e33 --- /dev/null +++ b/src/clang-format-all.sh @@ -0,0 +1,6 @@ +# Running it twice corrects some bugs in clang-format. +for run in {1..2} +do + clang-format -i -style=file include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp +done +git checkout include/flatbuffers/reflection_generated.h diff --git a/src/clang-format-git.sh b/src/clang-format-git.sh new file mode 100644 index 0000000..0611cbb --- /dev/null +++ b/src/clang-format-git.sh @@ -0,0 +1,6 @@ +# Running it twice corrects some bugs in clang-format. +for run in {1..2} +do + git clang-format HEAD^ -- include/flatbuffers/* src/*.cpp tests/*.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp +done +git checkout include/flatbuffers/reflection_generated.h diff --git a/src/clang-format.sh b/src/clang-format.sh deleted file mode 100644 index fbce6b9..0000000 --- a/src/clang-format.sh +++ /dev/null @@ -1,2 +0,0 @@ -clang-format -i -style=file include/flatbuffers/* src/*.cpp tests/test.cpp samples/*.cpp grpc/src/compiler/schema_interface.h grpc/tests/*.cpp -git checkout include/flatbuffers/reflection_generated.h -- 2.7.4