-
-
Notifications
You must be signed in to change notification settings - Fork 277
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
Fix the build with a shallow clone of RuboCop #39
Conversation
50006bd
to
80bbd10
Compare
Dir["#{rubocop_gem_path}/spec/support/**/*.rb"].each { |f| require f } | ||
rubocop_path = File.join(File.dirname(__FILE__), '../vendor/rubocop') | ||
unless File.directory?(rubocop_path) | ||
fail "Can't run specs without a local RuboCop checkout. Look in the README." |
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 doesn't seem to be any README in this PR?
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.
True. I was hoping to get feedback on the code before writing README (and PR description).
On 22/06/2015, at 23.44, Andy Waite [email protected] wrote:
In spec/spec_helper.rb:
@@ -2,8 +2,11 @@
require 'rubocop'
-rubocop_gem_path = Gem::Specification.find_by_name('rubocop').gem_dir
-Dir["#{rubocop_gem_path}/spec/support/*/.rb"].each { |f| require f }
+rubocop_path = File.join(File.dirname(FILE), '../vendor/rubocop')
+unless File.directory?(rubocop_path)
- fail "Can't run specs without a local RuboCop checkout. Look in the README."
There doesn't seem to be any README in this PR?—
Reply to this email directly or view it on GitHub.
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.
The README has been changed to include information about RuboCop’s spec helpers.
Added README info and PR description. |
Ping @andyw8 |
Thanks for the pull request! As soon as I have the time I'm having a look. Sorry that I have to let you wait, but its not forgotten.. |
No problem :-) |
ping @geniou. Might make sense to make @bquorning a maintainer or point to his fork or something |
Autocorrecting was changed in RuboCop v0.31: rubocop/rubocop#1833
My gut feeling is that having to clone RuboCop is not so good. But I'm not really familiar enough with RuboCop to suggest a better approach. |
The problem is that in order to run the specs for |
Perhaps @bbatsov can suggest a better approach? |
We could add the spec helpers back into the gem? |
Sorry for my silence.. I'm really sorry for that and thanks for the pull request! I get the problem but I also think the need of having to clone of rubocop is not perfect.. I see some options:
I personally would like the second one.. bur maybe for now we should go for the first one and then try to replace it by a better (long term) solution.. opinions? |
Just for reference the commit on rubocop that caused that problem: rubocop/rubocop@5e8199e We could also - as work around - use a version of rubocop that still delivers the required files.. |
Depending on an old version of RuboCop is not a good idea, I think. Wouldn't that make this gem useless for people using a newer version of RuboCop? Another (temporary) solution would be to simply copy the RuboCop spec helpers into this project. |
I don't know if there is a solution where you have development dependencies different from the one on production.. I think it's more than only one file so coping is not a good solution as well. |
I'm going to merge this even in the knowledge that its not a perfect solution to have this @bquorning thanks for the PR and all you afford! |
Fix the build with a shallow clone of RuboCop
❤️ Thanks. |
😃 |
Running the specs depends on being able to load RuboCop's spec helpers. Since the RuboCop gem no longer (as of v0.30.0) contains the spec files, we have to vendorize RuboCop.
We can make a git submodule, or we can make a git clone, and I have only heard bad things about using submodules in git. And making a shallow clone is relatively fast.
Potential issues: