-
Notifications
You must be signed in to change notification settings - Fork 453
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
ruby-beautify ignores Rubocop "Exclude" flags #1773
Comments
I looked at the code, and this is happening because of how the temp file is written - it does not preserve the path and does not set the working directory, so Rubocop does not exclude the files as expected when it is run. Here it is simply writing a temp file: # src/beautifiers/rubocop.coffee:54
"--config", configFile
tempFile = @tempFile("temp", text, '.rb')
], {ignoreReturnCode: true}) However, this should be writing out to the relative path of the file with the correct file name, so that excludes are not ignored. Something like |
Thanks for reporting this issue and diving into the code to investigate further! Pull Requests are always welcome and it would be great to improve Rubocop support. Thanks in advance! |
This issue has been automatically marked as stale because it has not had recent activity. If this is still an issue, please add a comment. It will be closed if no further activity occurs. Thank you for your contributions. |
Published to v0.32.0 |
Description
Given that I have this in my
.rubocop.yml
file:I expect that atom-beautify would not run the Style/BlockDelimiters cop on my spec files.
Unfortunately that's not the case. When running a beautification, it ignores the Exclude setting, even though running
rubocop
from the command line works properly.Input Before Beautification
This is what the code looked like before:
Expected Output
It should not change from the input.
Actual Output
The beautified code actually looked like this:
This meant that Style/BlockDelimiters ran on the spec. This does not happen when running rubocop from the command line.
Steps to Reproduce
Add this to the project
.rubocop.yml
Create a file like this under
/spec
:Run command
Atom Beautify: Beautify Editor
This beautified code should not change!
Debug
The Debug file outputs a lot of NDA-violating content, so I can't post it.
Checklist
I have:
so I know this is not a duplicate issue
Atom Beautify: Help Debug Editor
command in Atom and added link fordebug.md
Gist to this issueThe text was updated successfully, but these errors were encountered: