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
Add
crystal tool dependencies
#13613Add
crystal tool dependencies
#13613Changes from 3 commits
6ccfa19
021cb03
6cc019e
666034d
e3241cc
a677640
864a2f9
7d6b60a
c2d3477
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.
Can this be expressed as an extra parameter of
Crystal::Command#compile_no_codegen
? In that case the command-line argument handling would be done inside#create_compiler
itself, similar tohierarchy
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 would be the benefit? It seems to me this is a pretty simple setup. Yes, it's some duplicate code. But that's not bad. Combining everthing in one place adds quite a bit of complexity.
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 haven't run this branch yet, but I believe this means the tool doesn't have access to any of the common command-line options that other tools have (
-D
,--prelude
etc.)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.
There is indeed a problem with this approach:
crystal tool dependencies
still shows the full help rather than this help, but the option parser only ever accepts this-f
, and not the actually shown options like-h
. In particular this-f tree|flat
conflicts with the other-f text|json
.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.
If
crystal tool hierarchy
accepts-D
and--prelude
, so should this tool; this is not merely a matter of code duplicationThere 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 actual common piece that should be reused for a single option parser instance is
create_compiler
. Utilizingcompile_no_codegen
would add unnecessary complexity for no real gain.