Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Centralize dependency logic #975
Centralize dependency logic #975
Changes from 8 commits
e746893
8b0da8a
927e8c0
7ea430a
9baabe4
9d60be2
f442b26
fe91373
4a897f4
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Would you mind to change it to just
p
? I know usingp.dependency
will be less verbose inside the function but just for the purpose of consistency.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.
This change was in response to a comment by @ittaiz . I am fine either way.
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.
@borkaehw why do you think this is a better pattern in general?
Let’s ignore consistency for a sec since maybe we’ll decide to change the pattern
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 keep the function signature as simple as possible. By the fact that
p
should contain all the information we need, we may expand the data structure within the function instead.In my opinion,
make the phase architecture messy. When we finalize #965, I imagine the functions should all be consistent like
phase_a(ctx, internal_proviers)
.Also, functions with a super long list of arguments like
compile_scala
makes it hard to read. I, in general, prefer to keep arguments as less as possible and no keyword is needed.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.
@borkaehw I understand the value in what you say but to be honest I actually quite disagree with it. I think that bottom line having similar APIs is less beneficial than having phases explicitly declare which internal providers they need. Something like
providers = [JavaInfo]
which we have in startlark.Having said that I'd rather not start this debate here over this change and so for consistency I apologize @Jamie5 and I'll ask you to revert to your original change. Sorry again.
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.
Sounds good. Thanks for sharing your idea.