-
Notifications
You must be signed in to change notification settings - Fork 112
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 check command #231
Add check command #231
Conversation
63a162e
to
6ba6d39
Compare
c73d648
to
c049deb
Compare
73cd8d5
to
b794ebb
Compare
68f8a0b
to
0ac3d8e
Compare
228adc5
to
910c3a4
Compare
RBI files are out-of-date, please run `generate command` to update. | ||
Reason: New file(s) introduced. | ||
OUTPUT | ||
assert_includes($?.to_s, "exit 1") # rubocop:disable Style/SpecialGlobalVars |
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.
Want to make a special note about this. I was intending to use Process.last_status
which wasn't available in Ruby 2.4. So I opted to use this with the rubocop
exception as it's just for tests to work around the IO.popen(...)
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.
🎩 seems to work neatly to me!
Let's cut an issue for the refactors somewhere IMO since there are a few worth tracking.
Possible future improvement: Quieter output that just writes the result and the reason like
RBI files are out-of-date, please run `tapioca dsl` to update.
Reason: New file(s) introduced.
option :verify, | ||
type: :boolean, | ||
default: false, | ||
desc: "Verifies RBIs are up-to-date" |
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.
Might be worth explicitly saying that it doesn't modify anything in the description.
c094793
to
92848f3
Compare
92848f3
to
ac676f4
Compare
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 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.
Thanks Cory, nice job 🙂
Motivation
We need an easy way to check whether or not the RBI files are out-of-date after updates are made to files, Gems are bumped, etc. This adds a
check
command totapioca
that will re-generate the DSL (excluding Gems) to diff against to determine whether or nottapioca dsl
needs to be run.Implementation
Create a
tmpdir
usingDir.mktmpdir
, generate the DSL in the temp directory, and diff against that to determine if RBIs are out of sync.The command returns with an exit status of
0
if no changes are detected, and1
if changes are detected. This will allow for it to be used in CI pipelines.Tests
Adds two additional tests that ensure that the command returns the correct exit code as well as messaging to advise on correct next steps.