mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-13 10:40:29 +03:00
load lint_licenses where it is needed to avoid circular imports
This is the only thing that common.py imports from lint.py.
This commit is contained in:
parent
16fb0fbe91
commit
53b62415d3
2 changed files with 14 additions and 7 deletions
|
|
@ -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'],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
"""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
|
||||
if app.License not in config['lint_licenses']:
|
||||
if config['lint_licenses'] == APPROVED_LICENSES:
|
||||
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'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue