Skip to content

Commit

Permalink
Validation error for unknown licenses says how to fix the validation (#…
Browse files Browse the repository at this point in the history
…19566)

* Validation error for unknown licenses says how to fix the validation

* add changelog
  • Loading branch information
iliakur authored Feb 6, 2025
1 parent e841251 commit fd82342
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions ddev/changelog.d/19566.fixed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Validation error for unknown licenses says how to fix the validation.
9 changes: 8 additions & 1 deletion ddev/src/ddev/cli/validate/licenses.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,14 @@ def licenses(app: Application, sync: bool):
license_ids.add(known_spdx_licenses[normalized_license])
else:
license_ids.add(expanded_license)
package_license_errors[package_name].append(f'unknown license: {expanded_license}')
package_license_errors[package_name].append(
'Encountered unknown license. Options to fix this error:\n'
'- If it is truly a new license type, add it to exclusions '
'or known licenses in ddev/cli/validate/license_utils.py\n'
'- If it is known but formatted in a way that we cannot parse it, '
'hard-code a known version of it .ddev/config.toml\n\n'
f'Here is the license for reference:\n{expanded_license}'
)

for classifier in data['classifiers']:
if classifier in licenses_utils.KNOWN_CLASSIFIERS:
Expand Down

0 comments on commit fd82342

Please sign in to comment.