Skip to content

Commit

Permalink
Merge pull request #1017 from qtomlinson/qt/fix_maven_sourcearchive
Browse files Browse the repository at this point in the history
Fix NoAssertion cases in maven and sourcearchive typed packages
  • Loading branch information
qtomlinson authored Dec 4, 2023
2 parents 2e2083f + 73da3b1 commit 6e88ccf
Show file tree
Hide file tree
Showing 6 changed files with 20,286 additions and 10 deletions.
11 changes: 9 additions & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ function isLicenseFile(filePath, coordinates) {
if (_licenseFileNames.includes(basePath)) return true
if (!coordinates) return false
for (const prefix of getLicenseLocations(coordinates) || []) {
if (_licenseFileNames.includes(filePath.replace(prefix, ''))) return true
const prefixLowered = prefix.toLowerCase()
if (_licenseFileNames.includes(filePath.replace(prefixLowered, ''))) return true
}
return false
}
Expand All @@ -338,7 +339,13 @@ function isDeclaredLicense(identifier) {
}

function getLicenseLocations(coordinates) {
const map = { npm: ['package/'], maven: ['meta-inf/'], pypi: [`${coordinates.name}-${coordinates.revision}/`], go: [goLicenseLocations(coordinates)] }
const map = {
npm: ['package/'],
maven: ['META-INF/'],
pypi: [`${coordinates.name}-${coordinates.revision}/`],
go: [goLicenseLocations(coordinates)]
}
map.sourcearchive = map.maven
return map[coordinates.type]
}

Expand Down
Loading

0 comments on commit 6e88ccf

Please sign in to comment.