summaryrefslogtreecommitdiffstats
path: root/rfc.sh
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-08-22 12:31:48 +0530
committerNigel Babu <nigelb@redhat.com>2018-09-12 11:48:34 +0000
commitbe77dbbda692792335a8e9e7c02e0c281f003c40 (patch)
tree4c50b342ebd12452e8938a404e60481dbab47118 /rfc.sh
parentbc4201b4c23eee0e3d09a6760b449a0011677cd5 (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-xrfc.sh19
1 files changed, 18 insertions, 1 deletions
diff --git a/rfc.sh b/rfc.sh
index 6947aa24231..607fd7528fb 100755
--- a/rfc.sh
+++ b/rfc.sh
@@ -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