We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style/Encoding
Running RuboCop autocorrect on a file containing a line:
# Encoding: UTF-8
causes an infinite loop. I think this is because EditorComment#without only matches on lowercase tokens.
EditorComment#without
Rubocop removes the offending line.
>rubocop --autocorrect Inspecting 36 files C Offenses: test.rb:1:1: C: [Corrected] Style/Encoding: Unnecessary utf-8 encoding comment. # Encoding: UTF-8 ^^^^^^^^^^^^^^^^^ 0 files inspected, 1 offense detected, 1 offense corrected Infinite loop detected in test.rb and caused by Style/Encoding C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rubocop-1.61.0/lib/rubocop/runner.rb:332:in `check_for_infinite_loop'
Encoding: UTF-8
Encoding
rubocop --autocorrect
1.61.0 (using Parser 3.3.0.5, rubocop-ast 1.31.1, running on ruby 3.1.3) [x64-mingw-ucrt]
The text was updated successfully, but these errors were encountered:
[Fix rubocop#12738] Fix an error for Style/Encoding
c69eb83
Fixees rubocop#12738. This PR fixes an error for `Style/Encoding` when magic encoding with mixed case present.
6674cc8
No branches or pull requests
Running RuboCop autocorrect on a file containing a line:
# Encoding: UTF-8
causes an infinite loop. I think this is because
EditorComment#without
only matches on lowercase tokens.Expected behavior
Rubocop removes the offending line.
Actual behavior
Steps to reproduce the problem
Encoding: UTF-8
comment (Encoding
must not be all in lowercase).rubocop --autocorrect
.RuboCop version
The text was updated successfully, but these errors were encountered: