-
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
converting prettydiff to prettydiff2 #1750
Conversation
@prettydiff Awesome! Could you link any "requires Pretty Diff update" related issues for Atom-Beautify to here? I want to know which Issues I should comment on once this has been merged. Thank you! |
Yeah, I will look for those issues as a following administrative effort over the weekend. Right now I am just trying to get a green build. The new prettydiff2 NPM package is really just the minimum for CLI execution so it is about 1.3mb unminified instead of 23mb of the complete application. |
The code configuration seems to be correct now as the code samples are beautified in the build. I need to review the failing samples and determine where updates need to be made. |
I am having some trouble with two unit tests.
The first one is beautified with JS Beautify, so I don't really control that one. I did test it against Pretty Diff and it works flawless after a minor modification now in NPM. The second one is beautified by Pretty Diff and appears to be failing because all the tag names and attribute names are converted to lowercase. This is something that happens for HTML, but I treat XML as case sensitive. I did not see the Please let me know what guidance you have. |
So the We want the grammar to be atom-beautify/src/languages/ux_markup.coffee Lines 11 to 18 in 70dbad5
I think this is the language package for Atom we would want: https://github.com/ibare/language-fuse/blob/master/grammars/ux.cson#L2 And it is missing here: https://github.com/Glavin001/atom-beautify/blob/master/spec/beautify-languages-spec.coffee#L46-L53 So I recommend:
|
Pretty Diff supports ERB: https://github.com/Glavin001/atom-beautify/blob/master/src/beautifiers/prettydiff.coffee#L48 From Travis CI failing build:
The default beautifier for ERB is Pretty Diff: https://github.com/Glavin001/atom-beautify/blob/master/src/languages/erb.coffee#L22 Looks like another problem with Atom detecting an incorrect language. We want grammar So... what the heck Atom!? |
package.json
Outdated
@@ -225,6 +225,7 @@ | |||
"atom-beautify:beautify-language-go", | |||
"atom-beautify:beautify-language-golang template", | |||
"atom-beautify:beautify-language-fortran", | |||
"atom-beautify:beautify-language-fuse", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Fuse the Atom-Beautify language? I thought it was UX Markup
.
Note that these should be automatically generated/added, so if you find yourself adding this option, it should actually not be there 😜 .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing...
@@ -2,7 +2,7 @@ module.exports = { | |||
|
|||
name: "UX Markup" | |||
namespace: "ux" | |||
fallback: ['html'] | |||
fallback: ['xml'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may change the behaviour for current users of UX Markup
. Did this solve anything by changing it to xml
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just figured this grammar was more closely related to XML than HTML. It did not appear to have any effect in the build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just figured this grammar was more closely related to XML than HTML.
This is true, however any users who are leveraging the html
fallback will experience an unforeseen breaking change.
It did not appear to have any effect in the build.
Unfortunately, our builds do not have great coverage 😝 . Something I hope to address with Unibeautify.
"gfm", "go", "html", "html-swig", "java", "javascript", | ||
"json", "less", "lua", "marko", "mustache", "objective-c", | ||
"perl", "php", "python", "ruby", "sass", "sql", | ||
"svg", "xml" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot, it also needed to be added to Travis CI's install list: https://github.com/prettydiff/atom-beautify/blob/002b668ca23b2a0932ee3cd079c212c6f5e731d9/.travis.yml#L59
And AppVeyor: https://github.com/prettydiff/atom-beautify/blob/002b668ca23b2a0932ee3cd079c212c6f5e731d9/appveyor.yml#L136
Looks like language-fuse
is missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure why but adding language-fuse to the build artifacts makes the build time out.
@Glavin001 @prettydiff What can be done to help with this PR? |
Travis CI builds to pass would be a start. Also I need time to do a code review. Sorry I haven't had a chance to yet. I'll try to bulk review and merge Pull Requests this weekend. |
On the erb issue, Atom is definitely selecting HTML as the grammar. Atom 1.07 seems to be the last where EDIT: Confirmed, I manually stated to use
|
For the UX issue, I think the reason it times out is because it's not being activated properly, see https://discuss.atom.io/t/how-do-i-activate-a-package-in-specs/18766. Is it being tested right now? If so, how? Going to bed now. EDIT: I tried the fuse package, and although I get fuse could not be spawned when installing the package, the tests do run. But the all the tag and attribute names are still being converted to lower case, despite it recognizing the grammar/language/namespace as UX/UX Markup/ux and Pretty Diff being the beautifier. So if Update 2: I opened an issue on language-fuse, it hasn't been updated in 2 years so don't know if there will be a response. I don't see a purpose in having an activationCommand in package.json for that package. |
@szeck87 The beautified ERB output looks correct to me. I am looking at the test file and it appears the test file is wrong. There is an extra step of indentation as though the doctype is a start tag: https://github.com/Glavin001/atom-beautify/blob/master/examples/nested-jsbeautifyrc/html-erb/expected/test.erb |
@prettydiff Sorry, I'm actually going off of the prettydiff2 branch from this PR: https://github.com/prettydiff/atom-beautify/blob/prettydiff2/examples/nested-jsbeautifyrc/html-erb/expected/test.erb. Beautifying the original file from that branch doesn't match the indentations there in the expected. |
@szeck87 I updated that test sample in my fork. |
@prettydiff Looks good, the erb test passed. I think the only issue left, apart from the fuse packages and getting the proper grammar correctly which are both Atom issues, is the UX file test going to lowercase. I did confirm that if you install |
The erb files just need to be renamed from |
@szeck87 Files renamed. |
@@ -175,7 +175,7 @@ | |||
"node-dir": "0.1.17", | |||
"node-uuid": "1.4.8", | |||
"open": "0.0.5", | |||
"prettydiff": "1.16.37", | |||
"prettydiff2": ">2.2.5", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does prettydiff2
follow semver? If so, this should be ^2.2.5
so no major version is updated.
@@ -2,7 +2,7 @@ module.exports = { | |||
|
|||
name: "UX Markup" | |||
namespace: "ux" | |||
fallback: ['html'] | |||
fallback: ['xml'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just figured this grammar was more closely related to XML than HTML.
This is true, however any users who are leveraging the html
fallback will experience an unforeseen breaking change.
It did not appear to have any effect in the build.
Unfortunately, our builds do not have great coverage 😝 . Something I hope to address with Unibeautify.
Restarting build. Let's see how it goes. |
I created a new PR where I can push changes: #1878 |
Update prettydiff dependency from version 1.16.37 to 2.2.3.