diff --git a/fdroidserver/common.py b/fdroidserver/common.py index bda93d65..0451d3c7 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -66,7 +66,6 @@ from urllib.parse import urlparse, urlsplit, urlunparse from zipfile import ZipFile import fdroidserver.metadata -import fdroidserver.lint from fdroidserver import _ from fdroidserver.exception import FDroidException, VCSException, NoSubmodulesException, \ BuildException, VerificationException, MetaDataException @@ -187,7 +186,6 @@ default_config = { 'archive_name': 'My First F-Droid Archive Demo', 'archive_description': _('These are the apps that have been archived from the main repo.'), # type: ignore 'archive_older': 0, - 'lint_licenses': fdroidserver.lint.APPROVED_LICENSES, # type: ignore 'git_mirror_size_limit': 10000000000, 'scanner_signature_sources': ['suss'], } diff --git a/fdroidserver/lint.py b/fdroidserver/lint.py index 64770476..c5794476 100644 --- a/fdroidserver/lint.py +++ b/fdroidserver/lint.py @@ -578,11 +578,20 @@ def check_format(app): def check_license_tag(app): - """Ensure all license tags contain only valid/approved values.""" - if config['lint_licenses'] is None: - return - if app.License not in config['lint_licenses']: - if config['lint_licenses'] == APPROVED_LICENSES: + """Ensure all license tags contain only valid/approved values. + + It is possible to disable license checking by setting a null or empty value, + e.g. `lint_licenses: ` or `lint_licenses: []` + + """ + if 'lint_licenses' in config: + lint_licenses = config['lint_licenses'] + if lint_licenses is None: + return + else: + lint_licenses = APPROVED_LICENSES + if app.License not in lint_licenses: + if lint_licenses == APPROVED_LICENSES: yield _( 'Unexpected license tag "{}"! Only use FSF or OSI ' 'approved tags from https://spdx.org/license-list'