Examples:
./scripts/checkfiles fs/foo/bar.c
./scripts/checkfiles fs/foo/*.c
./scripts/checkfiles fs/foo # check all sources under fs/foo
./scripts/checkfiles . # check entire kernel
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
---
scripts/checkfiles | 34 ++++++++++++++++++++++++++++++++++
1 files changed, 34 insertions(+), 0 deletions(-)
create mode 100644 scripts/checkfiles
diff --git a/scripts/checkfiles b/scripts/checkfiles
new file mode 100644
index 0000000..bd5d3f0
--- /dev/null
+++ b/scripts/checkfiles
@@ -0,0 +1,34 @@
+#!/bin/sh
+# (c) 2007, Erez Zadok <ezk@cs.sunysb.edu> (initial version)
+# Licensed under the terms of the GNU GPL License version 2
+#
+# Check source files for compliance with coding standards, using terse
+# output in the style that g/cc produces. This output can be easily parsed
+# within text editors (e.g., emacs/vim) which can produce a split text
+# screen showing in one screen the error message, and in another screen the
+# corresponding source file, with the cursor placed on the offending line.
+# See for example the documentation for Emacs's "next-error" command, often
+# bound to M-x ` (ESC x back-tick).
+
+# Usage: checkfiles file [files...]
+# if "file" is a directory, will check all *.[hc] files recursively
+
+# check usage
+usage() {
+ echo "Usage: checkfiles file [files...]"
+ echo "(if \"file\" is a directory, check recursively for all C sources/headers)"
+ exit 1
+}
+if test -z "$1" ; then
+ usage
+fi
+if ! test -f scripts/checkpatch.pl ; then
+ echo "checkfiles: must run from top level source tree"
+ exit 1
+fi
+
+# check coding-style compliance of each source file found, using terse output
+find "$@" -type f -name '*.[hc]' | \
+while read f ; do
+ diff -u /dev/null $f | perl scripts/checkpatch.pl -t -
+done
--
1.5.2.2
-
| David Miller | [GIT]: Networking |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Joerg Roedel | [PATCH 4/8] x86: add alloc_coherent dma_ops callback to NOMMU driver |
| Nicholas A. Bellinger | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Petr Baudis | [ANNOUNCE] TopGit - A different patch queue manager |
| Mike | I don't want the .git directory next to my code. |
| Linus Torvalds | Be more careful about updating refs |
| Jonathan del Strother | blame vs annotate? |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Corey Minyard | Re: Seagate ST-01/02 info/experiences |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
| Cary Sandvig | Re: possible bug in gcc2.3.3 with C++ function templates |
| Linux Kernel Mailing List | powerpc/mpc5121: Update device tree for MPC5121ADS evaluation board |
| Linux Kernel Mailing List | KVM: Free apic access page on vm destruction |
| Linux Kernel Mailing List | KVM: hlt emulation should take in-kernel APIC/PIT timers into account |
| Linux Kernel Mailing List | lxfb: rename kernel arg fbsize to vram |
