summaryrefslogtreecommitdiff
path: root/doc/maintainer-guidelines.txt
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@intel.com>2015-02-02 09:49:53 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2015-02-02 09:49:53 +0200
commit1fb2b9035e53630591f5139e0c7740f6b189c0b5 (patch)
tree724e2317c07b7a9aba94832481a8cd93ea47e5d8 /doc/maintainer-guidelines.txt
parentd0c385570d7cb4221eacf3ba992ecf09935b42c3 (diff)
downloadbluez-1fb2b9035e53630591f5139e0c7740f6b189c0b5.tar.gz
doc/maintainer-guidlines: Add rule about coding-style
Diffstat (limited to 'doc/maintainer-guidelines.txt')
-rw-r--r--doc/maintainer-guidelines.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/doc/maintainer-guidelines.txt b/doc/maintainer-guidelines.txt
index f7218436a..3358c45ff 100644
--- a/doc/maintainer-guidelines.txt
+++ b/doc/maintainer-guidelines.txt
@@ -64,3 +64,26 @@ repositories.
Violations of this rule create a mess in the tree that can not be
reversed. If in doubt ask one of the seasoned maintainers.
+
+Rule 3: Enforce correct coding style
+====================================
+
+The coding style follows roughly the kernel coding style with any
+exceptions documented in doc/coding-style.txt.
+
+To ensure trivial white-space errors don't get committed, have the
+following in your .gitconfig:
+
+ [apply]
+ whitespace = error
+
+It can also be helpful to use the checkpatch.pl script coming with the
+Linux kernel to do some automated checking. Adding the following to your
+.git/hooks/pre-commit and .git/hooks/pre-applypatch is a simple way to
+do this:
+
+ exec git diff --cached | ~/src/linux/scripts/checkpatch.pl -q \
+ --no-tree --no-signoff --show-types \
+ --ignore CAMELCASE,NEW_TYPEDEFS,INITIALISED_STATIC -
+
+The above assumes that a kernel tree resides in ~/src/linux/.