-
Notifications
You must be signed in to change notification settings - Fork 84
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 Steep::RakeTask
#995
Add Steep::RakeTask
#995
Conversation
Thanks! I guess we don't need |
That makes sense to me -- I am not familiar with all the commands yet, as I am new to steeplife, so I will defer to you. Removed 👍 |
@soutaro Do you have any more feedback or concerns here? If not, I can do some cleanup and add documentation to the README.md about setting up rake tasks, and possibly write a test or two. |
@Aesthetikx Looks good. Having a few tests would be great. 👍 |
Some of the commands I’d explicitly write
I say, before we turn the commands into Rake tasks, we need to first figure out what each command is.
|
I'll try to write tests this weekend :)
I'll let others chime in here, but I'd just say I agree that for the most part I would continue to just use the |
That’s what I’m implying: Some of the command make no sense in CI contexts. |
8c2bae4
to
b74545a
Compare
OK, I cleaned up a bit and added some tests -- I think this is ready for review now 🫖 |
a4efff0
to
d16bfe2
Compare
This is to address #667. I am starting this PR as a draft for some discussion, if this seems like a good direction I can rebase, squash, add tests, and documentation.
This adds a
Rake::TaskLib
subclass similar to other projects likerubocop
andrspec
, such that a user can add an entry into their ownRakefile
to have access to rake tasks for this project. For example,would add the following tasks, e.g. the output of
bundle exec rake -T
now includes:There is also the ability to add some configuration, e.g.
Command line arguments can be similarly passed in typical
rake
fashion:or equivalently
The rake tasks are automatically generated from
Steep::CLI.available_commands
, so hopefully this is mostly forwards compatible if the CLI changes. There is some metaprogramming to automatically translate.severity_level = :error
into--severity-level error
and.verbose
into--verbose
, which possibly has some room for improvement.The default
steep
task is aliased tosteep:check
, as I feel that this is the most common use case.I typically have an entry like this at the bottom of Rakefiles for my projects:
So, this addition should make it easy to add steep to CI pipelines etc. such that simply typing
rake
will run the tests, typecheck, and lint.If the CLI command returns nonzero, the rake task exits nonzero, similar to how rubocop and rspec behave. This way, e.g. in the example above, rubocop will not run if steep does not exit cleanly. It will also prevent CI from completing successfully if steep detects any issues.
I was considering changing the default severity level to
error
as I feel this will be most common -- I did not make that change but I am open to input.