8000 srb-rbi with no args just prints usage (#1006) by pje · Pull Request #1063 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

srb-rbi with no args just prints usage (#1006) #1063

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

Merged
merged 2 commits into from
Jul 3, 2019

Conversation

pje
Copy link
Contributor
@pje pje commented Jun 26, 2019

Implements #1006.

AFAICT there were no tests for srb-rbi! So I didn't write any.

@pje pje requested a review from a team June 26, 2019 03:28
@ghost ghost requested review from DarkDimius and removed request for a team June 26, 2019 03:28
@jez
Copy link
Collaborator
jez commented Jun 26, 2019

AFAICT there were no tests for srb-rbi! So I didn't write any.

Yeah there are regrettably no tests for any subcommand other than srb init :(

@DarkDimius
Copy link
Collaborator

I'll refer to @jez and @ptarjan as they worked on UX for srb.
I remember discussions that srb by default in setup project might be equivalent to srb tc but I'm not sure where did they land.

@DarkDimius DarkDimius requested review from jez and removed request for DarkDimius June 26, 2019 04:45
@pje
Copy link
Contributor Author
pje commented Jun 26, 2019

Yeah there are regrettably no tests for any subcommand other than srb init :(

I'd be happy to add like a simple minitest unit test for this! I see that you're using minitest elsewhere.

Copy link
Collaborator
@jez jez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delayed response.

I'm fine with the new feature itself, but it seems like a rather big diff for such a small feature. Is there a reason for that? Or is the diff size accidental?

Also, looks like you have some merge conflicts since this branch was opened. I'll try to review it faster next time so you don't get conflicts.

@jez
Copy link
Collaborator
jez commented Jun 27, 2019

I'd be happy to add like a simple minitest unit test for this! I see that you're using minitest elsewhere.

We don't want to use minitest for this. We want to test the CLI itself. I'd prefer to leave this untested, unless you build something like the existing gems/sorbet/test/snapshot/driver.sh test harness. It currently hard codes srb init for the purpose of testing:

https://github.com/sorbet/sorbet/blob/master/gems/sorbet/test/snapshot/test_one.sh#L249

See the README to see what i mean.

@pje pje force-pushed the srb-rbi-with-no-args-just-prints-usage branch from 525afb7 to 7c81499 Compare June 27, 2019 15:16
@pje
Copy link
Contributor Author
pje commented Jun 27, 2019

@jez: I've rebased from master and reduced the diff size (most of that was just due to re-ordering some method definitions). I think this is ready to go!

LMKWYT!

@@ -73,7 +102,7 @@ actions:
STDOUT.write(emojify("❔", "Would you like to continue? [Y/n] "))
if STDIN.isatty && STDOUT.isatty
begin
input = Kernel.gets&.strip
input = STDIN.gets&.strip
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had to change because of this

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just ran into this issue myself running srb rbi update. If this PR gets delayed I'd love to see this change as a separate PR.

8000
Copy link
@adsteel adsteel Jun 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now see there's another PR of yours addressing this as well. #1066. Thanks for your work!

@pje
Copy link
Contributor Author
pje commented Jun 28, 2019

@jez: Anything blocking this getting merged?

@jez
Copy link
Collaborator
jez commented Jul 2, 2019

@pje sorry for the delay. this looks great to me, thanks!

i'll merge when the test pass.

@jez
Copy link
Collaborator
jez commented Jul 2, 2019

@pje I had to refactor some things to get the tests to pass. You can see the diff in 93bb628 . The tl;dr is that because the parse_command method didn't exit the program, it would cause the usage output to show up even after a 100% successful run of srb init. Our tests failed because of this, and it should be fixed now. I'm just waiting for the tests to pass to be sure.

@jez jez merged commit a1a4384 into sorbet:master Jul 3, 2019
@pje
Copy link
Contributor Author
pje commented Jul 8, 2019

Thanks for the assist, @jez! 🙇

pje added a commit to pje/sorbet that referenced this pull request Jul 15, 2019
* Rebase from master, decrease diff size as much as possible

* Fix tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0