1 From d54d785a28afb65811c5d5ad727c57233deb6f60 Mon Sep 17 00:00:00 2001
2 From: Kurt Mahan <kmahan@freescale.com>
3 Date: Wed, 31 Oct 2007 16:36:51 -0600
4 Subject: [PATCH] Scripts to allow running files through checkpatch.pl
6 Scripts based on scripts/checkfiles that are in various trees.
8 These should not be sent up because there are already patches from
9 the original script author.
11 LTIBName: mcfv4e-checkfiles-script
12 Signed-off-by: Kurt Mahan <kmahan@freescale.com>
14 scripts/checkfiles | 35 +++++++++++++++++++++++++++++++++++
15 scripts/checkfilesterse | 34 ++++++++++++++++++++++++++++++++++
16 2 files changed, 69 insertions(+), 0 deletions(-)
17 create mode 100755 scripts/checkfiles
18 create mode 100755 scripts/checkfilesterse
21 +++ b/scripts/checkfiles
24 +# (c) 2007, Erez Zadok <ezk@cs.sunysb.edu> (initial version)
25 +# Licensed under the terms of the GNU GPL License version 2
27 +# Check source files for compliance with coding standards, using terse
28 +# output in the style that g/cc produces. This output can be easily parsed
29 +# within text editors (e.g., emacs/vim) which can produce a split text
30 +# screen showing in one screen the error message, and in another screen the
31 +# corresponding source file, with the cursor placed on the offending line.
32 +# See for example the documentation for Emacs's "next-error" command, often
33 +# bound to M-x ` (ESC x back-tick).
35 +# Usage: checkfiles file [files...]
36 +# if "file" is a directory, will check all *.[hc] files recursively
40 + echo "Usage: checkfiles file [files...]"
41 + echo "(if \"file\" is a directory, check recursively for all C sources/headers)"
45 +# if test -z "$@" ; then
48 +if ! test -f scripts/checkpatch.pl ; then
49 + echo "checkfiles: must run from top level source tree"
53 +# check coding-style compliance of each source file found
54 +find "$@" -type f -name '*.[hc]' | \
56 + diff -u /dev/null $f | perl scripts/checkpatch.pl -
59 +++ b/scripts/checkfilesterse
62 +# (c) 2007, Erez Zadok <ezk@cs.sunysb.edu> (initial version)
63 +# Licensed under the terms of the GNU GPL License version 2
65 +# Check source files for compliance with coding standards, using terse
66 +# output in the style that g/cc produces. This output can be easily parsed
67 +# within text editors (e.g., emacs/vim) which can produce a split text
68 +# screen showing in one screen the error message, and in another screen the
69 +# corresponding source file, with the cursor placed on the offending line.
70 +# See for example the documentation for Emacs's "next-error" command, often
71 +# bound to M-x ` (ESC x back-tick).
73 +# Usage: checkfiles file [files...]
74 +# if "file" is a directory, will check all *.[hc] files recursively
78 + echo "Usage: checkfiles file [files...]"
79 + echo "(if \"file\" is a directory, check recursively for all C sources/headers)"
85 +if ! test -f scripts/checkpatch.pl ; then
86 + echo "checkfiles: must run from top level source tree"
90 +# check coding-style compliance of each source file found, using terse output
91 +find "$@" -type f -name '*.[hc]' | \
93 + diff -u /dev/null $f | perl scripts/checkpatch.pl -t -