From be77dbbda692792335a8e9e7c02e0c281f003c40 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 22 Aug 2018 12:31:48 +0530 Subject: 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 --- doc/developer-guide/coding-standard.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'doc/developer-guide') diff --git a/doc/developer-guide/coding-standard.md b/doc/developer-guide/coding-standard.md index 9bc15a5cc15..7c1beddc2d5 100644 --- a/doc/developer-guide/coding-standard.md +++ b/doc/developer-guide/coding-standard.md @@ -1,6 +1,30 @@ GlusterFS Coding Standards ========================== +Before you get started +---------------------- +Before starting with other part of coding standard, install `clang-format` + +On Fedora: + +$ dnf install clang + +On debian/Ubuntu: + +$ apt-get install clang + +Once you are done with all the local changes, you need to run below set of commands, +before submitting the patch for review. + + $ git add $file # if any + $ git commit -a -s -m "commit message" + $ git show --pretty="format:" --name-only | grep -v "contrib/" | egrep "*\.[ch]$" | xargs clang-format -i + $ git diff # see if there are any changes + $ git commit -a --amend # get the format changes done + $ ./submit-for-review.sh + + + Structure definitions should have a comment per member ------------------------------------------------------ -- cgit