-
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
Ensure license headers adher to Cargo manifest #58
Conversation
@paritytech/opstooling A ping for review :) |
license-scanner/types.ts
Outdated
@@ -114,7 +116,7 @@ export class DB { | |||
} | |||
|
|||
export type RustCrateScannerOutput = { | |||
license: string | null | undefined; | |||
license: string | null | undefined | { workspace: true }; |
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.
Feels like a realy weird type, and I can't find how it's used.
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.
Okay, so now we return Inheritable<>
from the scanner, which is {workspace: true}
, but do we somehow use it?
If we wanted just to avoid crash, why not return null there?
If we wanted to resolve inherited properties, why didn't we do it in rust scanner, why expose it to ts part?
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.
Great points.
I didn't want to resolve inherited properties, I created an issue and didn't want to spend time on it, because this functionality is not being used for years.
But now that I think about it again, it should be rather simply to resolve it now.
I'll take another look at it. If not, I'll return null as you suggest.
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.
@mutantcornholio I redid it, now I just return null instead of those inheritable types without using them.
Added a new test target - a crate with inherited properties.
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.
LGTM
Cargo.toml
#44include
parameter #45.rust-crate-scanner
to properly parse inherited properties in Cargo.toml.rust-crate-scanner
does not handle inherited properties #56, but at least it doesn't crash.