-
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 Errors Inserted after Beautify #2092
Comments
Please run the Debug command in Atom under Packages -> Atom Beautify -> Debug. Copy/paste the contents to a gist here on GitHub. This will give us more information to help look into this issue. |
Here's the link to the debug info: https://gist.github.com/AGMNS/6be05de0536f12b0ebd060b226f4a7f8 |
I'm getting the same output in my console, but not in the editor. So it could be a Windows specific bug, or a bug with the old @AGMNS please try this and see if it makes a difference:
Restart Atom (just in case) and see if that makes a difference. Looking for a Windows machine so I can look into further. |
In both instances the entry is empty in my settings. Since it is only displaying "Default:" I'm assuming there's really nothing to do there. Strange that both my brother and I are experiencing this same problem after the latest Atom 64x release and updating the Atom-Beautify. AGMNS |
Interesting, the logs point to the Rubocop path being The only other thing is that it might not like the file being on an E drive. Can you copy/paste the contents into an unsaved file, change the grammar of the file to Ruby, and beautify it? Does it have the same output? |
I copied and pasted the contents and saved the file to c:/users/AGMNS Opened the file in Atom and beautified. Same result. |
OK, I'll have to find a Windows machine to see what is going on. |
OK, we've done some digging on our end and discovered something. How this translates into the broader scope of what's happening will require some digging. I'm suspecting the latest release of Atom may have something to do with it. Something has changed with the windows environment. The code below in the latest Atom-Beautifier is the same code that exists in the previous version of Atom-Beautifier that worked. That's why I'm wondering if something changed in that last Atom release 12 days ago. Here's the steps in Atom.
You'll notice that the split happens on the sting of equal signs and a line feed \n. HOWEVER if on the windows machine you view hidden characters you will see that Atom inserts a \r\n. So I guessed that this might have something to do with it and changed the line to include \r\n, Saved and restarted Atom. With that change Atom-Beautify returns the script beautified as it should without the error comments at the top. Hope this points in the right direction. |
Thanks for the information, that is helpful. I changed my Atom settings to use CRLF instead of LF, and still wasn't able to reproduce it, which leads me to believe it is very specific to Windows or at least Rubocop Windows. But weird that our CI build for Windows doesn't have a problem. Anyhow, a bug is a bug. We'll have to look at the OS and determine whether it should be |
@AGMNS I started a PR to fix this, however the Windows CI build (using AppVeyor) failed. Can you try replacing your rubocop.coffee with the contents here: https://raw.githubusercontent.com/szeck87/atom-beautify/132f7026cd174a08f2b70bef29fdafa872d2f0e8/src/beautifiers/rubocop.coffee. All it does it requires the EDIT: Can you also tell me what you have in the line-ending-selector package for Default line ending? And also for those Ruby files what your status bar has for the line ending? Looks like this (for me it's LF): |
Ok, that works without a problem. Status bar is CRLF line-ending-selector package is set to OS Default AGMNS |
OK, I'm not able to make sense of what is happening. I'll need to investigate further. |
Fixed with v0.32.5. |
After updating Atom-Beautify today to 0.32.2 within Atom 1.25.0 64x and running against ruby code error results are inserted at the top of the code. I have uninstalled and reinstalled Beautify and have also checked with another user who now has the same issue. This may be related to the version of Atom, I'm not sure. In addition if code is copied and pasted after running beautify additional line feeds are added to the existing line feeds as you can see below.
Before Beautify:
After Beautify:
The text was updated successfully, but these errors were encountered: