-
-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prefer exact license match over SPDX
Add a new matcher_order attribute to LicenseMatch and use it for sorting matches rather than the matcher string. This was we can ensure that there is a proper precedence between matchers when two matches are matching exactly the same text. The new sort order for matcher is like that: - 0: 1-hash - 1: 2-aho - 2: 1-spdx-id - 3: 3-seq - 4: 5-undetected - 5: 5-aho-frag - 6: 6-unknown The outcome is that a hash or aho match for the same text at the same position will take precedence of the SPDX id match, allowing to curate and correct some incorrect license expressions if needed. Reference: #3912 Reported-by: Ayan Sinha Mahapatra <[email protected]> Signed-off-by: Philippe Ombredanne <[email protected]>
- Loading branch information
1 parent
9a7df2c
commit c581828
Showing
9 changed files
with
98 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* SPDX-License-Identifier: (GPL-2.0+ OR BSD) |
2 changes: 2 additions & 0 deletions
2
tests/licensedcode/data/datadriven/lic4/bsd-bare-in-spdx.txt.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
license_expressions: | ||
- gpl-2.0-plus OR bsd-new |