-
Notifications
You must be signed in to change notification settings - Fork 68
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 TIP output is going to files on auto save #138
Comments
I'm unable to set
It seems like this is triggered by the presence of a We want default rubocop behavior because we can't justify writing a config file for this project (ruby is not our main language) so I'm looking for a way to workaround this bug without having a |
@cspotcode the message you're getting is due to RuboCop marking new cops as pending between major releases. You can choose to automatically enable or disable them by default in your AllCops:
NewCops: [enable|disable] # choose one
SuggestExtensions: false See https://docs.rubocop.org/rubocop/1.6/versioning.html for more details. |
The bug here is that those messages should not be written into the .rb
source file. The extension is writing them into the .rb source file,
meaning that attempting to save an .rb file causes the editor to append
invalid syntax, (those messages) breaking the file.
Diagnostic, warning, and error messages should be displayed in VSCode's
interface, not written into source code. If the existence of those
messages makes it impossible to format a file, then the file should remain
unmodified.
…On Mon, Dec 21, 2020, 1:54 AM Daniel Vandersluis ***@***.***> wrote:
@cspotcode <https://github.com/cspotcode> the message you're getting is
due to RuboCop marking new cops as pending between major releases. You can
choose to automatically enable or disable them by default in your
.rubocop.yml along with SuggestExtensions: false, which will continue to
use the default rubocop configuration but remove the warning messages
you're experiencing):
AllCops:
NewCops: [enable|disable] # choose one
SuggestExtensions: false
See https://docs.rubocop.org/rubocop/1.6/versioning.html for more details.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#138 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAC35OHDJY6CM74RWQ7RFT3SV3WJPANCNFSM4UMRHOZQ>
.
|
I had the same problem. |
I have the same problem. The time I am saving thanks to rubocop I am wasting because of the garbage it writes to .rb files. |
This is not a RuboCop bug, but rather a bug of how this library is calling RuboCop. The suggested extensions text only is added when using a formatter that is intended for human consumption. If this library used a RuboCop formatter meant for parsing ( |
So it seems like this is a bug that breaks the extension. Is there a fix? From this code which sets the args and the
I can't work on this right now so am just going to disable the suggested extensions. |
After upgrading to 1.5.1, Rubocop by default prints the following message in the console when you run the command:
This exact message appears at the end of every file when I save using the auto formatting in the VSCode Extension.
Versions
Relevant VSCode preferences
Setting the option
SuggestExtensions: false
as showed by Rubocop fixes the issue; for now.The text was updated successfully, but these errors were encountered: