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

Update license detections #3620

Merged
merged 12 commits into from
Jan 16, 2024
Merged

Conversation

AyanSinhaMahapatra
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra commented Dec 7, 2023

This adds the following LicenseDetection updates:

  • Adds a from-file attribute with LicenseMatch origin No way to obtain LicenseMatch origin #3608
  • Adds a new reference-matches attribute at top-level LicenseDetection objects
  • Add SPDX license-expression everywhere we have license-expression (i.e in detections and also matches?)
  • Adds all rule attribute level info for detections in --todo
  • Reorder LicenseMatch attributes
  • Add a new attribute for license text diagnostics

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Looked for possible updates in documentation and added updates if applicable
  • Updated CHANGELOG.rst

Adds a new attribute to document the origin path from matches
so we can determine in the cases of de-referenced matches, the
location these came from, and also to differentiate between
matches that come from the same file or from a different file.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Here `from-file` attributes were being assigned after creation of
top level packages so we had them empty. Adds a temporary fix to
this.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the update-license-detections branch from 9a49600 to dbffe43 Compare December 7, 2023 12:25
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the update-license-detections branch from 37ef122 to a1fc5d8 Compare December 7, 2023 15:22
In case of license detection issues in todo items,
add rule attributes as additional context which are
usually not added to license match data.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Adds a new attribute license_expression_spdx to both LicenseMatch and
LicenseDetection objects, and reflected also in top-level detections and
todo items. Basically this adds the SPDX license-expression everywhere
we have a license-expression.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
AyanSinhaMahapatra and others added 3 commits December 12, 2023 23:00
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
This commit adds a new attribute for license text diagnostics
which will be added when the CLI option `--license-text-diagnostics`
is used, in contrast to earlier behaviour, where this diagnostics
matched text used to overwrite the text in `matched_text`.

Also makes sure top-level license/package summarizations have
matched text and diagnostics correcttly only when the respective
CLI options are used.

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
Fixes the SPDX rule identifier mismatch bug by getting rid of
extra space introduced in SPDX license declaration detection
and text cleaning. Also enforce python safe names for identifiers.

Reference: #3634
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the update-license-detections branch from 8c1c37f to c631e73 Compare January 10, 2024 13:48
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here are a few nits for your consideration.

AyanSinhaMahapatra added a commit that referenced this pull request Jan 16, 2024
Reference: #3620

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
AyanSinhaMahapatra added a commit that referenced this pull request Jan 16, 2024
Reference: #3620

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the update-license-detections branch from 2cf3a77 to 2d72d2f Compare January 16, 2024 18:27
Reference: #3620

Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra AyanSinhaMahapatra force-pushed the update-license-detections branch from 2d72d2f to 2f80ae3 Compare January 16, 2024 18:46
@AyanSinhaMahapatra
Copy link
Member Author

Thanks @pombredanne, addressed everything from your suggestions. Merging now!

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit f70bbb7 into develop Jan 16, 2024
31 of 33 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the update-license-detections branch January 16, 2024 21:29
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 this pull request may close these issues.

3 participants