chiark / gitweb /
lint: more versatile /HEAD warning
authorDaniel Martí <mvdan@mvdan.cc>
Sat, 28 Nov 2015 10:32:46 +0000 (11:32 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Sat, 28 Nov 2015 10:58:56 +0000 (11:58 +0100)
Now catches many more github/gitlab/bitbucket links

fdroidserver/lint.py

index 7821b5811675a413ead5ce75435c9e1b64572329..f7d79255f5a703a31284591759d119932592ec2a 100644 (file)
@@ -55,8 +55,8 @@ http_url_shorteners = [
 http_checks = https_enforcings + http_url_shorteners + [
     (re.compile(r'.*github\.com/[^/]+/[^/]+\.git'),
      "Appending .git is not necessary"),
-    (re.compile(r'(.*/blob/master/|.*raw\.github.com/[^/]*/[^/]*/master/|.*/raw/master/)'),
-     "Use /HEAD/ instead of /master/ to point at a file in the default branch"),
+    (re.compile(r'.*://[^/]*(github|gitlab|bitbucket|rawgit)[^/]*/([^/]+/){1,3}master'),
+     "Use /HEAD instead of /master to point at a file in the default branch"),
 ]
 
 regex_checks = {