Skip to content
New issue

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

rubocop --auto-correct remove my own emacs editor comment unexpectly. #10014

Closed
zw963 opened this issue Aug 14, 2021 · 0 comments · Fixed by #10023
Closed

rubocop --auto-correct remove my own emacs editor comment unexpectly. #10014

zw963 opened this issue Aug 14, 2021 · 0 comments · Fixed by #10023
Assignees
Labels

Comments

@zw963
Copy link

zw963 commented Aug 14, 2021

bin/parse_insider:2:1: C: [Corrected] Style/Encoding: Unnecessary utf-8 encoding comment.
# -*- coding: utf-8; mode: enh-ruby; -*-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expected behavior

remove coding: utf-8; but keep mode: enh-ruby;

Actual behavior

remove the comment entirely.

Describe here what actually happened.
Please use rubocop --debug when pasting rubocop output as it contains additional information.

Steps to reproduce the problem

This is extremely important! Providing us with a reliable way to reproduce
a problem will expedite its solution.

RuboCop version

1.19.0
Ruby 3.0.2

@dvandersluis dvandersluis self-assigned this Aug 16, 2021
dvandersluis added a commit to dvandersluis/rubocop that referenced this issue Aug 17, 2021
…operly.

Refactors `Style/Encoding` to make use of the `MagicComment` class. Now `Style/Encoding` can handle the following situations:
* multiple encoding magic comments
* encoding magic comments following other magic comments
* magic comments containing multiple directives (only the encoding is removed)
bbatsov pushed a commit that referenced this issue Aug 18, 2021
Refactors `Style/Encoding` to make use of the `MagicComment` class. Now `Style/Encoding` can handle the following situations:
* multiple encoding magic comments
* encoding magic comments following other magic comments
* magic comments containing multiple directives (only the encoding is removed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants