From 1fb2b9035e53630591f5139e0c7740f6b189c0b5 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Mon, 2 Feb 2015 09:49:53 +0200 Subject: [PATCH] doc/maintainer-guidlines: Add rule about coding-style --- doc/maintainer-guidelines.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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/. -- 2.47.3