Remove a pair from an hash #12214
Unanswered
BigBigDoudou
asked this question in
Q&A
Replies: 1 comment
-
Here is one solution: add_offense(pair) do |corrector|
corrector.remove(pair)
corrector.remove_preceding(
pair,
pair.source_range.begin_pos - pair.left_siblings.last.source_range.end_pos
)
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm stuck with the auto correction with hashes. Some keys should not be authorized and I want the auto correction to remove them. For example if the keys are
foo
andbar
and the code is:then the correction should be:
but because I remove the pair (
correcter.remove(pair)
) the correction is actually:Do you have any how I could handle that?
Beta Was this translation helpful? Give feedback.
All reactions