diff options
author | Amar Tumballi <amarts@redhat.com> | 2018-08-22 12:31:48 +0530 |
---|---|---|
committer | Nigel Babu <nigelb@redhat.com> | 2018-09-12 11:48:34 +0000 |
commit | be77dbbda692792335a8e9e7c02e0c281f003c40 (patch) | |
tree | 4c50b342ebd12452e8938a404e60481dbab47118 /rfc.sh | |
parent | bc4201b4c23eee0e3d09a6760b449a0011677cd5 (diff) |
clang-format: add the config file
Also update the required documents and scripts to enable clang-format
Change-Id: I73aae6db06c2f732a1779d59a73bc05e28beafba
updates: bz#1564149
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'rfc.sh')
-rwxr-xr-x | rfc.sh | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -303,7 +303,7 @@ main() return; fi - check_patches_for_coding_style; + # check_patches_for_coding_style rebase_changes; @@ -320,6 +320,23 @@ main() warn_reference_missing; fi + # TODO: add clang-format command here. It will after the changes are done everywhere else + clang_format=$(clang-format --version) + if [ ! -z "${clang_format}" ]; then + # Considering git show may not give any files as output matching the + # criteria, good to tell script not to fail on error + set +e + list_of_files=$(git show --pretty="format:" --name-only | + grep -v "contrib/" | egrep --color=never "*\.[ch]$"); + if [ ! -z "${list_of_files}" ]; then + echo "${list_of_files}" | xargs clang-format -i + fi + set -e + else + echo "High probability of your patch not passing smoke due to coding standard check" + echo "Please install 'clang-format' to format the patch before submitting" + fi + if [ "$DRY_RUN" = 1 ]; then drier='echo -e Please use the following command to send your commits to review:\n\n' else |