libmctp: Add code formatting script

The OpenBMC CI system looks for a 'format-code.sh' in the root of the
repository, and if found, executes it instead of running its own
formatter configuration.

The CI configuration pays respect to the .clang-ignore file we ship, but
shipping one makes it harder invoke the code formatter with so many
files ignored. Introduce a format-code.sh script to reduce the
tedium of fixing style issues found by CI testing.

Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: I491442de56cff723207fbb9a82980040c287f0c2
diff --git a/format-code.sh b/format-code.sh
new file mode 100755
index 0000000..d34554d
--- /dev/null
+++ b/format-code.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+: ${CLANG_FORMAT:=clang-format}
+
+FILES=$(comm -3 <(sort .clang-ignore) <(git ls-files | grep '.*\.[ch]$' | sort))
+
+if [ -n "$FILES" ]
+then
+    $CLANG_FORMAT -style=file -i $FILES
+fi