From d0559f864e4f578e6794f3b24a832d44ccd4af52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 18 Aug 2015 17:54:32 -0700 Subject: [PATCH] Warn about url shorteners being used --- fdroidserver/lint.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 189b52ed..9c59fd37 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -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