summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-03-26 12:56:43 -0500
committerAdriana Kobylak <anoo@us.ibm.com>2018-04-10 09:52:23 -0500
commitf62262b3fc6ff552b649a7fcf3825d4830ecbedb (patch)
treeac359fe89872867e5710dacdba949592baea53cb
parentf1b07cec5e1b854989a1b07cd05d4b74a9be94e7 (diff)
downloadopenbmc-docs-f62262b3fc6ff552b649a7fcf3825d4830ecbedb.tar.gz
openbmc-docs-f62262b3fc6ff552b649a7fcf3825d4830ecbedb.zip
cpp-style: Add format-code.sh to clang section
With commit https://gerrit.openbmc-project.xyz/#/c/9480/ support for a format-code.sh script is being added to CI. Add it to the documentation for users to take advantage of. Change-Id: I11c56c94c3110a7279db72caf55738d88fc35302 Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--cpp-style-and-conventions.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/cpp-style-and-conventions.md b/cpp-style-and-conventions.md
index 8923fa1..e550a39 100644
--- a/cpp-style-and-conventions.md
+++ b/cpp-style-and-conventions.md
@@ -152,6 +152,13 @@ code formatting on code check-in if a .clang_format file is found
within the root directory of the repository. This allows for automatic
validation of code formatting upon check-in.
+If a custom configuration is desired, such as using different clang formatting
+for C and C++ files, a format-code.sh script can be created, which can for
+example use different .clang* files as input depending on the file type.
+The format-code.sh script will be executed as part of CI if found in the root
+directory of the repository, and will check that there are no files that were
+modified after running it (same check as running clang).
+
OpenBMC requires a clang-format of version 5.0 or greater. An example of
how to run clang-format against all code in your repo can be found by
referencing the [tool](https://github.com/openbmc/openbmc-build-scripts/blob/master/scripts/format-code.sh) used by CI.
OpenPOWER on IntegriCloud