chiark / gitweb /
Warn about url shorteners being used
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 19 Aug 2015 00:54:32 +0000 (17:54 -0700)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 19 Aug 2015 00:54:32 +0000 (17:54 -0700)
fdroidserver/lint.py

index 189b52edef5ef4225d95a8ab29b62328c255b8e7..9c59fd37d768c8ac2de01d4da6d07df3c7a9d005 100644 (file)
@@ -44,7 +44,18 @@ https_enforcings = [
     enforce_https('googlecode.com'),
 ]
 
-http_warnings = https_enforcings + [
+
+def forbid_shortener(domain):
+    return (re.compile(r'https?://[^/]*' + re.escape(domain) + r'/.*'),
+            "URL shorteners should not be used")
+
+http_url_shorteners = [
+    forbid_shortener('goo.gl'),
+    forbid_shortener('t.co'),
+    forbid_shortener('ur1.ca'),
+]
+
+http_warnings = https_enforcings + http_url_shorteners + [
     (re.compile(r'.*github\.com/[^/]+/[^/]+\.git'),
      "Appending .git is not necessary"),
     # TODO enable in August 2015, when Google Code goes read-only