gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 188/256: checksrc: detect and warn for multiple spa


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 188/256: checksrc: detect and warn for multiple spaces
Date: Fri, 06 Oct 2017 19:44:39 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 59813726d1638880494e3675ae8230b6bdd21ee5
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Sep 12 09:28:37 2017 +0200

    checksrc: detect and warn for multiple spaces
---
 lib/checksrc.pl | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/lib/checksrc.pl b/lib/checksrc.pl
index 535e3d9f5..c1f74bebf 100755
--- a/lib/checksrc.pl
+++ b/lib/checksrc.pl
@@ -62,6 +62,7 @@ my %warnings = (
     'EQUALSNOSPACE'    => 'equals sign without following space',
     'NOSPACEEQUALS'    => 'equals sign without preceeding space',
     'SEMINOSPACE'      => 'semicolon without following space',
+    'MULTISPACE'       => 'multiple spaces used when not suitable',
     );
 
 sub readwhitelist {
@@ -563,6 +564,18 @@ sub scanfile {
                       "no space after semilcolon");
         }
 
+        # check for more than one consecutive space before open brace or
+        # question mark. Skip lines containing strings since they make it hard
+        # due to artificially getting multiple spaces
+        if(($l eq $nostr) &&
+           $nostr =~ /^(.*(\S)) + [{?]/i) {
+            checkwarn("MULTISPACE",
+                      $line, length($1)+1, $file, $ol,
+                      "multiple space");
+            print STDERR "L: $l\n";
+            print STDERR "nostr: $nostr\n";
+        }
+
         $line++;
         $prevl = $ol;
     }

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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