Rubocop changes #!/usr/bin/ruby
to
# !/usr/bin/ruby
adds a space after the hash when I use rubocop -a
, how can I avoid this
Rubocop changes #!/usr/bin/ruby
to
# !/usr/bin/ruby
adds a space after the hash when I use rubocop -a
, how can I avoid this
You'll have to disable the LeadingCommentSpace
cop. It ensures that there is a space between #
and the text that follows it. Puts something like this in your .rubocop.yml
:
LeadingCommentSpace:
enabled: false
What you've stumbled upon is a bug, that I'll fix in the next RuboCop release (I'm its author). Obviously #!
should be treated specially.