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
-
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Tarkan Erimer | Re: Slow DOWN, please!!! |
git: | |
| Kevin Ballard | Re: git on MacOSX and files with decomposed utf-8 file names |
| Jakub Narebski | Re: VCS comparison table |
| David | User's mailing list? And multiple cherry pick |
| Ken Pratt | pack operation is thrashing my server |
| Gerrit Renker | [PATCH 03/37] dccp: List management for new feature negotiation |
| Jiri Olsa | [PATCH] net: fix race in the receive/select |
| Jarek Poplawski | [PATCH take 2] pkt_sched: Protect gen estimators under est_lock. |
| Rick Jones | Re: RFC: Nagle latency tuning |
| Richard Stallman | Real men don't attack straw men |
| list-obsd-misc | Re: low-MHz server |
| Luca Corti | Re: About Xen: maybe a reiterative question but .. |
| Jerome Santos | sshd.config and AllowUsers |
