Skip to content
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

Add is_notice flag to the --classify option #3822

Open
pombredanne opened this issue Jun 24, 2024 · 1 comment · May be fixed by #4142
Open

Add is_notice flag to the --classify option #3822

pombredanne opened this issue Jun 24, 2024 · 1 comment · May be fixed by #4142

Comments

@pombredanne
Copy link
Member

I would like to have an is_notice flag to the --classify option. It is useful to more easily collect these to keep their text as a package notice text (such as with the Apache 2.0 NOTICEs)

This can be based on:

  • a key, legal file with the word "notice" in their lowered file name
  • a key, legal file which is mostly made of license text and mostly matched to a license notice
@tdruez
Copy link
Contributor

tdruez commented Jun 26, 2024

a key, legal file with the word "notice" in their lowered file name

As a side note, the is_legal is only true when the filename "starts or ends with", see
https://github.com/nexB/scancode-toolkit/blob/c326a0b6ed7dda44e40c8a436c7005672a1a53a9/src/summarycode/classify.py#L95-L107

This would mean that a filename such as "package_NOTICE.txt" may not be flagged as is_notice with the current behavior.
Something to consider during the implementation of a new is_notice attribute.

from commoncode.resource import Resource
from summarycode.classify import check_resource_name_start_and_end
from summarycode.classify import LEGAL_STARTS_ENDS

resource = Resource(name="package_NOTICE.txt", location=".", path=".")
is_legal = check_resource_name_start_and_end(resource, LEGAL_STARTS_ENDS)
print(is_legal)  # -> False

aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
@aayushkdev aayushkdev linked a pull request Feb 11, 2025 that will close this issue
6 tasks
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 11, 2025
aayushkdev added a commit to aayushkdev/scancode-toolkit that referenced this issue Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants