You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For /Users/dmitry.pogrebnoy/RubymineProjects/untitled25: Default configuration from /Users/dmitry.pogrebnoy/.rvm/gems/ruby-3.3.0-preview2-debug/gems/rubocop-1.56.3/config/default.yml
Use parallel by default.
Skipping parallel inspection: only a single file needs inspection
Inspecting 1 file
Scanning /Users/dmitry.pogrebnoy/RubymineProjects/untitled25/1.rb
W
Offenses:
1.rb:5:1: W: [Correctable] Lint/OrderedMagicComments: The encoding magic comment should precede all other magic comments.
# re = eval("# encoding: ISO-8859-1\n/foo \\xff?/")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 file inspected, 1 offense detected, 1 offense autocorrectable
Finished in 0.18397099990397692 seconds
Fixesrubocop#12213.
This PR fixes a false positive for `Lint/OrderedMagicComments`
when comment text `# encoding: ISO-8859-1` is embedded within example code as source code comment.
There is a specific case when the Lint/OrderedMagicComments cop produces a false-positive warning.
Here is an example:
Expected behavior
There is no warning.
Actual behavior
The Lint/OrderedMagicComments warning is present.
Here is an output
rubocop --debug
:Steps to reproduce the problem
RuboCop version
1.56.3 (using Parser 3.2.2.3, rubocop-ast 1.29.0, running on ruby 3.3.0) [arm64-darwin22]
The text was updated successfully, but these errors were encountered: