mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-11-09 17:00:12 +01:00
Add source and issue tracker link warnings
This commit is contained in:
parent
66e540772f
commit
f2b25679ff
@ -18,6 +18,7 @@
|
|||||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
import re
|
||||||
import common, metadata
|
import common, metadata
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
@ -48,6 +49,25 @@ def main():
|
|||||||
allapps = metadata.read_metadata(xref=False)
|
allapps = metadata.read_metadata(xref=False)
|
||||||
apps = common.read_app_args(args, allapps, False)
|
apps = common.read_app_args(args, allapps, False)
|
||||||
|
|
||||||
|
regex_warnings = {
|
||||||
|
'Source Code': [
|
||||||
|
(re.compile(r'.*code\.google\.com/p/[^/]+/source/.*'),
|
||||||
|
"/source is enough on its own"),
|
||||||
|
(re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
|
||||||
|
"/source is missing")
|
||||||
|
],
|
||||||
|
'Issue Tracker': [
|
||||||
|
(re.compile(r'.*code\.google\.com/p/[^/]+/issues/.*'),
|
||||||
|
"/issues is enough on its own"),
|
||||||
|
(re.compile(r'.*code\.google\.com/p/[^/]+[/]*$'),
|
||||||
|
"/issues is missing"),
|
||||||
|
(re.compile(r'.*github\.com/[^/]+/[^/]+/issues/.*'),
|
||||||
|
"/issues is enough on its own"),
|
||||||
|
(re.compile(r'.*github\.com/[^/]+/[^/]+[/]*$'),
|
||||||
|
"/issues is missing")
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
for app in apps:
|
for app in apps:
|
||||||
appid = app['id']
|
appid = app['id']
|
||||||
lastcommit = ''
|
lastcommit = ''
|
||||||
@ -70,6 +90,13 @@ def main():
|
|||||||
if any(lastchar==c for c in ['.', ',', '!', '?']):
|
if any(lastchar==c for c in ['.', ',', '!', '?']):
|
||||||
warn("Summary should not end with a %s" % lastchar)
|
warn("Summary should not end with a %s" % lastchar)
|
||||||
|
|
||||||
|
for f in ['Source Code', 'Issue Tracker']:
|
||||||
|
if f not in regex_warnings:
|
||||||
|
continue
|
||||||
|
for m, r in regex_warnings[f]:
|
||||||
|
if m.match(app[f]):
|
||||||
|
warn("%s url '%s': %s" % (f, app[f], r))
|
||||||
|
|
||||||
desc_chars = 0
|
desc_chars = 0
|
||||||
for line in app['Description']:
|
for line in app['Description']:
|
||||||
desc_chars += len(line)
|
desc_chars += len(line)
|
||||||
|
Loading…
Reference in New Issue
Block a user