Repository navigation
Make compatible with latest RuboCop - #448
Conversation
There was a problem hiding this comment.
I like the approach, but this changes the logic, you're missing an else SimpleCov::ResultMerger.merged_result case here to keep it in line with the previous version, no?
There was a problem hiding this comment.
Whoops, I think the right move is to get rid of the now-redundant if defined? @result. On the way.
There was a problem hiding this comment.
Reading this method makes me dizzy, maybe we get to untangle this a bit:
def result
# Ensure the variable is defined to avoid ruby warnings
@result = nil unless defined?(@result)
# Collect our coverage result
if running and not result?
@result = SimpleCov::Result.new add_not_loaded_files(Coverage.result)
end
# If we're using merging of results, store the current result
# first, then merge the results and return those
if use_merging
if result?
SimpleCov::ResultMerger.store_result @result
end
SimpleCov::ResultMerger.merged_result
else
@result
end
ensure
self.running = false
end22bf8ac to
09944ba
Compare
There was a problem hiding this comment.
I know this is not applied to all of the code base and this especially is "just" our test sample code, but personally I prefer the actual if/else form because it's easier to parse the control flow of the method
There was a problem hiding this comment.
Sure. Would you like me to disable that cop completely or special case this file?
There was a problem hiding this comment.
Which one is it and what is it complaining about? Can't see anything in the build log :(
There was a problem hiding this comment.
That would be the Style::GuardClause cop, which says:
Use a guard clause instead of wrapping the code inside a conditional expression.
7683485 to
241de7f
Compare
|
I've added the refactor of the |
|
Also, I think it'd be prudent to consider locking Would you be open to me making that change? |
|
@colszowka When you get a chance, I'm waiting on feedback on two points in order to proceed:
|
|
Thanks for keeping up on this thing!
Thanks again On Fri, Jan 22, 2016 at 2:14 PM -0800, "Craig Little" [email protected] wrote: @colszowka When you get a chance, I'm waiting on feedback on two points in order to proceed: What should we do about the Style/GuardClause cop? — |
241de7f to
6bc590e
Compare
This brings it up-to-date for `v0.36.0`. Changelog: https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md#0360-14012016
Since `rubocop` is pre-1.0, breaking changes are often introduced with each minor version release. By locking to a minor version series, we can update to the latest on our own schedule and avoid unexpected build failures in the meantime.
This gets the build to green for now. An issue will be opened to discuss what to do with this cop going forward.
6bc590e to
dfe701b
Compare
Locked to the And the build's 💚! |
Make compatible with latest RuboCop
|
Perfect, thanks @craiglittle |
This brings it up-to-date for
v0.36.0.Changelog: https://github.com/bbatsov/rubocop/blob/master/CHANGELOG.md#0360-14012016