You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm tidying up an old codebase, and have seen some instances of this pattern:
if good_data
..do stuff..
else
fail "bad data"
end
which I think would be nicer as:
fail "bad data" unless good_data
...do stuff...
but I don't think the Style/GuardClause cop currently catches this. There are cases where this is appropriate, though, for example case or chained elsifs :
case type_of_data
when data_type1
..do stuff 1..
when data_type2
..do stuff 2..
else
fail "bad data"
end
Does this warrant a feature request? (I'm currently on 0.35.1 (using Parser 2.2.3.0, running on ruby 2.2.2 x86_64-linux))
The text was updated successfully, but these errors were encountered:
I'm tidying up an old codebase, and have seen some instances of this pattern:
which I think would be nicer as:
but I don't think the Style/GuardClause cop currently catches this. There are cases where this is appropriate, though, for example
case
or chainedelsif
s :Does this warrant a feature request? (I'm currently on
0.35.1 (using Parser 2.2.3.0, running on ruby 2.2.2 x86_64-linux)
)The text was updated successfully, but these errors were encountered: