Skip to content

Question: pre-commit licensecheck failing because license unknown #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
cpolzer opened this issue Jan 23, 2025 · 1 comment
Open

Question: pre-commit licensecheck failing because license unknown #102

cpolzer opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@cpolzer
Copy link

cpolzer commented Jan 23, 2025

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

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 cpolzer added the question Further information is requested label Jan 23, 2025
@cpolzer cpolzer changed the title Question: lisencecheck failing because license unknown Question: pre-commit licensecheck failing because license unknown Jan 23, 2025
@FredHappyface
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants