-
Notifications
You must be signed in to change notification settings - Fork 216
[Incremental] Improve the interface to DependencySource #490
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
Conversation
|
@swift-ci please test |
|
@swift-ci please test |
| var externalDependencyToCheck: ExternalDependency? { externalDependency } | ||
| var isIncremental: Bool { | ||
| fingerprint != nil && externalDependency.isSwiftModule | ||
| var incrementalDependencySourceIfPresent: DependencySource? { |
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.
The ifPresent suffix here is already communicated by the type. https://swift.org/documentation/api-design-guidelines/#promote-clear-usage
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.
Please document the conditions where this returns nil since it's not just a matter of presence, right? If there aren't any fingerprints, you'll bail here with nil.
| try? fileSystem.getFileInfo(file).modTime | ||
| } | ||
|
|
||
| var swiftModuleFileIfPresent: TypedVirtualPath? { |
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.
Same here
| var isIncremental: Bool { | ||
| fingerprint != nil && externalDependency.isSwiftModule | ||
| var incrementalDependencySourceIfPresent: DependencySource? { | ||
| guard let _ = fingerprint, |
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.
| guard let _ = fingerprint, | |
| guard fingerprint != nil, |
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.
Happy to remove the ifPresent's. I was on the fence anyway. Wrt let _ = ..., I'm inclined to leave it in. That idiom is used a tad more frequently in this code than the != nil.
CodaFi
left a comment
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.
Just a few nits. Nothing to block things.
|
@swift-ci please test |
|
Thanks! |
Deal with erroneous file types a bit better.