chiark / gitweb /
lint: fix unlinkified links regex
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 24 Oct 2015 22:07:33 +0000 (00:07 +0200)
committerDaniel Martí <mvdan@mvdan.cc>
Sat, 24 Oct 2015 22:07:33 +0000 (00:07 +0200)
It was incorrectly matching:

foo [http://bar

and not matching:

http://foo (start of line)

fdroidserver/lint.py

index fb2ce2c0087ad10c25c20beeece93cb27138f259..82c6eddd8d950e7032267f544a36b3e643a2ba92 100644 (file)
@@ -97,7 +97,7 @@ regex_checks = {
          "Unnecessary trailing space"),
         (re.compile(r'.*([^[]|^)\[[^:[\]]+( |\]|$)'),
          "Invalid link - use [http://foo.bar Link title] or [http://foo.bar]"),
-        (re.compile(r'.*[^[]https?://[^ ]+'),
+        (re.compile(r'(^|.* )https?://[^ ]+'),
          "Unlinkified link - use [http://foo.bar Link title] or [http://foo.bar]"),
     ],
 }