Skip to content

Commit 462130a

Browse files
committed
feat(model): Handle notice files in PathLicenseMatcher
Relates to #6399. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 4368fb1 commit 462130a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

model/src/main/kotlin/utils/PathLicenseMatcher.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import org.ossreviewtoolkit.utils.common.getAllAncestorDirectories
4444
*/
4545
class PathLicenseMatcher(licenseFilePatterns: LicenseFilePatterns = LicenseFilePatterns.DEFAULT) {
4646
private val licenseFileMatcher = createFileMatcher(licenseFilePatterns.licenseFilenames)
47+
private val noticeFileMatcher = createFileMatcher(licenseFilePatterns.noticeFilenames)
4748
private val patentFileMatcher = createFileMatcher(licenseFilePatterns.patentFilenames)
4849
private val otherLicenseFileMatcher = createFileMatcher(licenseFilePatterns.otherLicenseFilenames)
4950

@@ -83,6 +84,7 @@ class PathLicenseMatcher(licenseFilePatterns: LicenseFilePatterns = LicenseFileP
8384
}.mapValues { it.value.toSet() }
8485

8586
val licenseFiles = filePathsByDir(licenseFileMatcher)
87+
val noticeFiles = filePathsByDir(noticeFileMatcher)
8688
val patentFiles = filePathsByDir(patentFileMatcher)
8789
val otherLicenseFiles = filePathsByDir(otherLicenseFileMatcher)
8890

@@ -107,6 +109,7 @@ class PathLicenseMatcher(licenseFilePatterns: LicenseFilePatterns = LicenseFileP
107109
addApplicableLicenseFiles(otherLicenseFiles)
108110
}
109111

112+
addApplicableLicenseFiles(noticeFiles)
110113
addApplicableLicenseFiles(patentFiles)
111114
}
112115

0 commit comments

Comments
 (0)