rufo
rufo copied to clipboard
Does not work when trying to rufoize code with pattern matching (ruby 2.7)
When trying to run rufo against code that has pattern matching, rufo results in error
➭ rufo -c /tmp/test.rb
You've found a bug!
It happened while trying to format the file /tmp/test.rb
Example code in question (with use of dry-monads gem):
require "dry/monads/all"
case Dry::Monads::Maybe(nil)
in Dry::Monads::Some(x)
puts x
in Dry::Monads::None
puts "2"
end
It does not work as well for "simple" matching, such as:
a = 1
case a
in 1
puts '1'
in 2
puts '2'
end
Are there plans to include support for pattern matching?
Hey @gingermusketeer do you know maybe if there are plans to include pattern matching syntax to rufo?
@rindek It will definitely be included at some point. Can you submit a PR with a failing test and I will take a look when I get a moment.
@gingermusketeer I've added couple tests, hope they are correct - see #250