Closed eregon closed 2 years ago
Thanks for noticing this. Pretty sure they are meant for Ruby, added as the first line in #33 (link to diff). https://github.com/sporkmonger/addressable/pull/309 added the blank line when adding frozen_string_literal
lines.
Comments like https://github.com/sporkmonger/addressable/blob/a079a52ba5a5cb43cadd5edaa684ee6874dafaa8/spec/addressable/idna_spec.rb#L3 (and in other files) might be intended as magic comments for Ruby. But they have no effect since they are after a blank line.
You can verify by changing it to
# coding: binary
, see it changes nothing, but if you move it as first line then specs break as expected.It probably still works in practice since UTF-8 is the default for recent Rubies.
Unless maybe such comments are purposefully not meant for Ruby and only editors or so?
Noticed while investigating https://github.com/oracle/truffleruby/issues/2408