mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-11-05 18:23:23 -05:00
lint: require https:// and no shorteners in Donate: links
This commit is contained in:
1 parent
4a1af27ab2
commit
34a6e2cfee
2 files changed
+16
-1
No files matched your search
@@ -154,7 +154,8 @@ regex_checks = {
|
||||
(re.compile(r'.*github\.com/[^/]+/[^/]+/*$'), _("/issues is missing")),
|
||||
(re.compile(r'.*gitlab\.com/[^/]+/[^/]+/*$'), _("/issues is missing")),
|
||||
],
|
||||
'Donate': http_checks
|
||||
'Donate': http_url_shorteners
|
||||
+ require_https
|
||||
+ [
|
||||
(
|
||||
re.compile(r'.*liberapay\.com'),
|
||||
|
||||
@@ -177,6 +177,20 @@ class LintTest(SetUpTearDownMixin, unittest.TestCase):
|
||||
logging.debug(warn)
|
||||
self.assertTrue(anywarns, f"{url} does not fail lint!")
|
||||
|
||||
def test_check_regexes_donate(self):
|
||||
app = fdroidserver.metadata.App()
|
||||
app.Donate = 'https://example.com/donate/'
|
||||
for warn in fdroidserver.lint.check_regexes(app):
|
||||
self.fail()
|
||||
|
||||
def test_check_regexes_donate_both(self):
|
||||
app = fdroidserver.metadata.App()
|
||||
app.Donate = 'http://bit.ly/givememoney/'
|
||||
warns = list(fdroidserver.lint.check_regexes(app))
|
||||
for warn in warns:
|
||||
self.assertIn('bit.ly', warn)
|
||||
self.assertEqual(2, len(warns))
|
||||
|
||||
def test_check_regexes_binaries(self):
|
||||
app = fdroidserver.metadata.App()
|
||||
app.Binaries = 'https://example.com/%v.apk'
|
||||
|
||||
Reference in new issue
Block a user