LicenseCheck icon indicating copy to clipboard operation
LicenseCheck copied to clipboard

Question: pre-commit licensecheck failing because license unknown

Open cpolzer opened this issue 10 months ago • 1 comments

Before You Begin

Before proceeding, please make sure to follow these steps:

  • [ x] I have checked for similar questions in the project's issue tracker to avoid duplicates.
  • [ x] I have searched existing issues to see if this question has been asked before.

Your Question

When using licensecheck as a pre-commit-hook with poetry and its toml file, i have to enter the

[tool.poetry]
license="xxxxx"

so that the hook does not fail.

In my current setup I have to use a "self" defined license which "licensecheck" does not know:

 WARNING  | licensecheck.license_matrix:licenseLookup:107 - 'LICENSEREF-xxxx' License not identified so falling back to NO_LICENSE
  • i am also not able to find it in the list of SPDX known licenses, but then it looks like the included license lists added to "licensecheck" are also not complete compared to https://github.com/spdx/license-list-XML?

Is there any way I can configure licensecheck so it does not fail the pre-commit-hook on this matter?

EDIT: i found that i can set the license to "proprietary", the warning is gone - but still the pre-commit hook fails:

# file pyproject.toml
[tool.poetry]
license = "Proprietary"
# file .pre-commit-config.yaml
  - repo: https://github.com/FHPythonUtils/LicenseCheck
    rev: "2024.3"
    hooks:
      - id: licensecheck
        stages: [pre-commit]

Thanks in advance!

cpolzer avatar Jan 23 '25 22:01 cpolzer

Yeah you're absolutely right that this lib supports quite a narrow subset of spdx licenses at this time. The reason for this is largely due to the time I can dedicate to the lib, and whilst IANAL etc, I'd still want to be confident that licenses are claim are compatible or not compatible are fairly likely to be correct. This has been changed to mark the license as UNKNOWN rather than not existing as that was some pretty misleading functionality!

It isn't really possible to identify what would be compatible with an unknown license imo. That said with proprietry its accpeted that permissive licenses like MIT are compatible but not more copyleft licenses like GPL and friends. Is that the issue you are now running into?

FredHappyface avatar Mar 16 '25 16:03 FredHappyface