Skip to content

Filter Ignorable Copyrights #372 - #2436

Closed
adityaviki wants to merge 1728 commits into
aboutcode-org:developfrom
adityaviki:filter_ignorable_copyrights
Closed

adityaviki wants to merge 1728 commits into
aboutcode-org:developfrom
adityaviki:filter_ignorable_copyrights

Conversation

@adityaviki

@adityaviki adityaviki commented Mar 12, 2021

Copy link
Copy Markdown
Contributor

A post-scan plugin to filter out ignorable-copyrights that are read from license's yaml file.

@adityaviki

Copy link
Copy Markdown
Contributor Author

@pombredanne let me know if I need to make any improvements to the code. I'll write the the tests for it afterwards.

@sritasngh

sritasngh commented Mar 21, 2021

Copy link
Copy Markdown
Contributor

Can you please edit the top comment and linked issue no along with your name! This makes easy to understand in that way:)
You could see here the template. Thank You for your contribution:)

@adityaviki adityaviki changed the title Filter Ignorable Copyrights #372 Filter Ignorable Copyrights Mar 21, 2021

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you ++
This is looking great! 🙇
It is missing one thing though before I can merge: some test.
Do you think you can draft one?

Comment thread docs/source/cli-reference/help-text-options.rst Outdated
@adityaviki

adityaviki commented Mar 30, 2021

Copy link
Copy Markdown
Contributor Author

Do you think you can draft one?

Yes of course :)

adityaviki added a commit to adityaviki/scancode-toolkit that referenced this pull request Mar 30, 2021
Signed-off-by: adityaviki <adityaviki01@gmail.com>
@adityaviki adityaviki closed this Mar 30, 2021
@adityaviki
adityaviki deleted the filter_ignorable_copyrights branch March 30, 2021 08:11
@adityaviki
adityaviki restored the filter_ignorable_copyrights branch March 30, 2021 08:11
@adityaviki adityaviki reopened this Mar 30, 2021
@adityaviki

adityaviki commented Mar 30, 2021

Copy link
Copy Markdown
Contributor Author

I didn't mean to close the PR or delete the branch. I wasn't paying attention to where I was clicking. :/

@adityaviki adityaviki changed the title Filter Ignorable Copyrights Filter Ignorable Copyrights #372 Mar 30, 2021
Comment thread src/cluecode/plugin_filter_ignorable_copyrights.py
@pombredanne

Copy link
Copy Markdown
Member

I didn't mean to close the PR or delete the branch. I wasn't paying attention to where I was clicking. :/

that's OK :)

Comment thread src/cluecode/plugin_filter_ignorable_copyrights.py
@adityaviki

Copy link
Copy Markdown
Contributor Author

@pombredanne I don't know how to solve the failing check.

@sritasngh

Copy link
Copy Markdown
Contributor

I don't know how to solve the failing check.

DCO check is falling because of this 55cea26 It has co-authour name but signed-off is missing. So what you can do is squash these changes to the original commit of your and add sign-off or you may ask @pombredanne to squash all the commits into one.

@adityaviki

Copy link
Copy Markdown
Contributor Author

@itssingh It's still not clear how to solve the issue.

This is for PR aboutcode-org#1864 and  aboutcode-org#1759

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This was triggering a FutureWarning

Reported-by: Thorsten Godau @tgodau
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Various GPL 3.0 licenses

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Avoid ambiguous license detection as MIT instead of Apache

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is for aboutcode-org#1759 as a follow up to PR aboutcode-org#1864
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Adopt SPDX v2.2 and fix SPDX TV correctness
pombredanne and others added 26 commits January 5, 2022 23:05
And spell spurious with one r, not two.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This support new ways to combine multiple license matches together,
and distinguish primary and secondary licenses.
Most concepts have been drawn from early work on Debian copyright
detection improvements.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
…-improvements

Add new licenses and new detection rules
Rather than using a function argument

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is a batch of misc. license detection rules and a new license.
These have been mostly found thanks to the upcoming unknown license
detection.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This makes it available in the CLI

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This is cleaner and more composable than old-style interpolation

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Add split_weak_matches() function to pre-filter weak unknown matches.
Make unknown matches eligible for filter_spurious_matches() and lower
minimum density to 0.6=5 for longer matches. Move the call for
filter_spurious_matches() earlier in the refine pipeline.

Add new filter_invalid_contained_unknown_matches() function to discard
unknown matches found inside the matched queryregion of larger regular
matches

Extract get_full_qspan_matched_text() function from
get_full_matched_text() for improve reusability. This is designed to be
called when crafting new rules absed on a match (which is what is done
with unknown matches).

Use format for matched license text highlight
This is cleaner and more composable than old-style interpolation.

Improve debug tracing of matched texts.

Apply other minor refactoring and doc impropvements

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Create unique rule id based on a checksum of the rule content

Also improve key phrases parsing for dnagling {{ {{ braces.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Create proper synthethic Rule and LicenseMatch on match and return
a match or None.

Include unknown licenses matching as an option to Index.match

Add tests

Use shorter ngrams of length 6 rather than 7 for better sensitivity
This is balanced by the addition of filters:
- Filter weak unknown matches at match time
- Filter out several weak unknown ngrams at index time

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Note that this is NOT YET returned in the API and outputs

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
…tection

Detect unknown licenses aboutcode-org#1675

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
In copyright detection results, rename the "value" attribute to proper
descriptive names, respectively: copyright, holder and author

Signed-off-by: akugarg <akanksha.garg2k@gmail.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
This second commit updates the tests and code that did not exist yet
at the time of the initial patch or code that failed to pass tests.

In copyright detection results, rename the "value" attribute to proper
descriptive names, respectively: copyright, holder and author.

Also:
- rename "copyright_holder" to "holder" in CSV output
- apply minor refactorings

Co-authorred-by: akugarg <akanksha.garg2k@gmail.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
We now use a set of Detection objects to streamline how things are
handled internally.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne pombredanne added this to the v32.1 milestone Jan 6, 2023
@pombredanne

Copy link
Copy Markdown
Member

@adityaviki this will be merged at last in v32.1 ... but it may be partially redundant with pre-existing ScanCode CLI options

@pombredanne

Copy link
Copy Markdown
Member

https://github.com/nexB/scancode-toolkit/blob/develop/src/cluecode/plugin_filter_clues.py has the feature and predates this PR. Thank you +++, closing.

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.