1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-10-05 18:50:09 +02:00

scanner: ignore gradle comment lines

Useful to detect:

	maven {
		// foo
		url "http://foo.bar"
	}
This commit is contained in:
Daniel Martí 2015-10-08 12:16:45 +02:00
parent 75b1c029ac
commit f7e9022217

View File

@ -191,7 +191,8 @@ def scan_source(build_dir, root_dir, thisbuild):
if is_used_by_gradle(line):
for name in suspects_found(line):
count += handleproblem('usual supect \'%s\' at line %d' % (name, i+1), fd, fp)
joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(lines))
noncomment_lines = [l for l in lines if not common.gradle_comment.match(l)]
joined = re.sub(r'[\n\r\s]+', ' ', ' '.join(noncomment_lines))
for m in gradle_mavenrepo.finditer(joined):
url = m.group(2)
if not any(r.match(url) for r in allowed_repos):