Skip to content
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

Pass --linter=rubocop --test=rspec to bundle gem #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sambostock
Copy link
Contributor

The generator expects to patch RSpec files, so specifying anything other than rspec as the test framework would break generation. Therefore, it makes sense to specify it ourselves, and save the user the time of having to select it.

It also seems very unlikely that someone would want to generate a RuboCop extension, but use a linter other than RuboCop, so let's save the user the time.

@@ -7,7 +7,7 @@ def initialize(name)
end

def generate
system('bundle', 'gem', '--test=rspec', name, exception: true)
system('bundle', 'gem', '--linter=rubocop', '--test=rspec', name, exception: true)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could also build on this by enabling some InternalAffairs cops by default.

For example, InternalAffairs/InheritDeprecatedCopClass is probably a good one to enable.

The generator expects to patch RSpec files, so specifying anything other
than `rspec` as the test framework would break generation. Therefore, it
makes sense to specify it ourselves, and save the user the time of
having to select it.

By doing this, we can also remove the patch to add the gem, since
Bundler will handle that for us.
It seems very unlikely that someone would want to generate a RuboCop
extension, but use a linter other than RuboCop, so let's save the user
the time.
@sambostock sambostock force-pushed the pass-default-options-to-bundle-gem branch from 03583ea to 40d38c9 Compare February 4, 2023 16:16
@sambostock
Copy link
Contributor Author

This turns out to be similar to #10, but takes a different approach, by forcing RSpec, rather than checking for it.

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.

1 participant