findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] [PATCH] Added example Bourne shell code sniffer


From: James Youngman
Subject: [Findutils-patches] [PATCH] Added example Bourne shell code sniffer
Date: Sat, 30 Jun 2007 13:07:17 +0100

---
 ChangeLog              |    2 ++
 build-aux/src-sniff.py |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index f5dd3b0..1491584 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
        sniffers, to allow checking types of file other than C.  Allow
        file-based regex sniffers to give an indication of the line number
        where they think the problem (or part of the problem) exists.
+       Added code smell detectors for a sample Bourne shell problem and
+       for out-of-date FSF addresses.
 
 2007-06-29  James Youngman  <address@hidden>
 
diff --git a/build-aux/src-sniff.py b/build-aux/src-sniff.py
index b571021..a46023c 100644
--- a/build-aux/src-sniff.py
+++ b/build-aux/src-sniff.py
@@ -104,6 +104,13 @@ checkers = [
     [r'59 Temple Place.*02111-?1307\s*USA',
      "out of date FSF address"],
     ]),
+    # Bourne shell code smells
+    RegexChecker('\.sh$',
+                 [
+                ['for\s*\w+\s*in.*;\s*do',
+                  # Solaris 10 /bin/sh rejects this, see Autoconf manual
+                  "for loops should not contain a 'do' on the same line."],
+                 ], []),
     ]
 
 
-- 
1.5.2.1





reply via email to

[Prev in Thread] Current Thread [Next in Thread]