I don’t think rubyfmt should have changed my source code. I understand (from #358) that the parentheses were removed because it looks better in Bundler’s gemfiles, but when I use group as a variable name, invalid code is produced. (The same problem happens if instead of group I use it, describe, gem, source, or ruby.)
A possible solution (with me having very little knowledge about rubyfmt’s internals) would be to check whether there are any method calls following the end-parenthesis before deciding whether it should be removed or not?
Input file
Rubyfmt's output
This breaks because
I don’t think rubyfmt should have changed my source code. I understand (from #358) that the parentheses were removed because it looks better in Bundler’s gemfiles, but when I use
group
as a variable name, invalid code is produced. (The same problem happens if instead ofgroup
I useit
,describe
,gem
,source
, orruby
.)A possible solution (with me having very little knowledge about rubyfmt’s internals) would be to check whether there are any method calls following the end-parenthesis before deciding whether it should be removed or not?