-
Notifications
You must be signed in to change notification settings - Fork 0
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
refactor: split search and fitting to status functionality #127
Conversation
# Conflicts: # packages/core/src/audit-licenses.ts
# Conflicts: # README.md # package-lock.json # packages/cli/src/components/audit-licenses/audit-licenses.tsx # packages/core/src/audit-licenses.ts # test/test/npm.test.ts # test/testProjects/monorepo/package-lock.json # test/testProjects/monorepo/package.json
if (!packageJsonResult.success) { | ||
//To code reviewer: Should we handle in in this or different way? | ||
errorResults.set(packageNameFromPath, { | ||
packagePath, | ||
errorMessage: packageJsonResult.errorMessage, | ||
}); | ||
continue; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current solution looks ok, what other way do you have in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was curious here, if we should add this error to the new errorResults map here.
// it("should return the correct license when file name matches a license name", () => { | ||
// const filePath = "LICENSE-Apache-2.0"; | ||
// const expectedLicense = LicenseSchema.parse(licenseMap.get("Apache-2.0")); | ||
// const result = retrieveLicenseFromLicenseFileName(filePath); | ||
// expect(result.licenses).toEqual([expectedLicense]); | ||
// }); | ||
|
||
it("should return an empty array when file name does not match any known license pattern", () => { | ||
const filePath = "LICENSE-UNKNOWN"; | ||
const result = retrieveLicenseFromLicenseFileName(filePath); | ||
expect(result.licenses).toEqual([]); | ||
}); | ||
}); | ||
// it("should return an empty array when file name does not match any known license pattern", () => { | ||
// const filePath = "LICENSE-UNKNOWN"; | ||
// const result = retrieveLicenseFromLicenseFileName(filePath); | ||
// expect(result.licenses).toEqual([]); | ||
// }); | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the situation with these tests? Should they be removed, uncommented, refactored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove the tests related to file names, as this functionality is removed in this PR.
@@ -66,6 +66,7 @@ export default function AuditResult({ | |||
warning, | |||
overrides, | |||
}: AuditResultProps) { | |||
//TODO handle errorResults here |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should implement this in this PR.
overrides: overrides, | ||
warning: warning, | ||
needsUserVerification: needsUserVerification, | ||
errorResults: errorResults, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be written like this:
return {
groupedByStatus,
notFound,
overrides,
warning,
needsUserVerification,
errorResults,
};
|
||
if (!packageJsonResult.success) { | ||
//To code reviewer: Should we handle in in this or different way? | ||
errorResults.set(packageNameFromPath, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also set process.exitCode = 1;
in this case here?
15a69a4
to
0618e74
Compare
9234229
to
c627f78
Compare
No description provided.