Atom-beautify: Update prettydiff to 2.1.11 from ^1.16.27

Created on 29 Sep 2016  路  11Comments  路  Source: Glavin001/atom-beautify

Description

The beautification on SCSS files works superbly except for maps. This is due to an error in prettydiff. An error that was fixed in 2.1.3

Input Before Beautification

As in the example in the prettydiff issue #338

$grid: (
  'max-width': (40 * $u),
  'columns': 12,
  'gutter': (.5 * $u)
);

Expected Output

The code should look indented and pretty :)

Actual Output

The beautified code actually looked like this:

$grid: ( 'max-width': (40 * $u), 'columns': 12, 'gutter': (.5 * $u) );

Steps to Reproduce

  1. Add code to Atom editor
  2. Run command Atom Beautify: Beautify Editor
  3. This beautified code does not look right!

The problem lies when you have a huge map 馃槩
My map is 861 characters long on a single line and I had to remove all the single line comments for it to work :(

third-party-bug

Most helpful comment

@aifrim While those libraries perform compression they are not archival tools. What I mean by this is that they do not convert a collection of files and directories into a single file. The tar.gz concept on POSIX addresses this by using tar to archive a file collection into a single file and then gunzip to compress that archive.

All 11 comments

The challenge is that the node based dependencies primarily come in from NPM. Pretty Diff stopped updating to NPM at 1.16.37. I am working on an alternative to NPM right now, but I have been too slow to get this complete and out the door.

This saddens me :(
It's hard to work with array lists in SCSS but I hope in time it will be fixed.

Weirdly NPM lists prettydiff at 99.0.1 馃槅

@aifrim you can also try switching the default beautifier to another one. See https://github.com/Glavin001/atom-beautify/blob/master/docs/options.md#scss for available options.

@Glavin001

I will, thank you! Sorry for replying so late - was on holiday!

I am getting really close on this and just wanted to post an update. Initial Pretty Diff publication via biddle is online in production: http://prettydiff.com/downloads/prettydiff/

Once you download biddle its as easy as:

node biddle global
biddle install http://prettydiff.com/downloads/prettydiff/prettydiff_cli_latest.zip

I will work on the next patch of Pretty Diff now in order to make biddle support formal to Pretty Diff's master branch and also fix some outstanding bugs. This will be part of an on-going beta process to work out defects and try to test features of the application in a way where these features are exposed to end users in production. It should be noted that biddle is still in beta mode. My confidence in the reliability of this application is rising, but I will need user input to determine what bugs are present.

@prettydiff How is the process going?

@Glavin001, forgot to tell you that other options behave the same way.

@aifrim Hard. I thought I had it working a month ago when I using native (OS) file copy, but then I discovered in production on Linux that it worked most of the time but sometimes it would fail to copy files over. I wrote my own copy utility using the Node.js API and it seems to work perfectly except that it breaks Zip on Windows. I am not sure if the callback is firing early or executing zip through powershell is unstable. I can use all the help I can get to solve this problem, because it is really crushing my soul. I thought I was so close and almost ready to recommend its usage.

https://github.com/prettydiff/biddle

@prettydiff

Why don't you use Node's zlib.Gzip and zlib.Unzip?

As for copying files without breaking them... are you copying ZIPs in binary mode? (dumb question, I know - but still)

@aifrim While those libraries perform compression they are not archival tools. What I mean by this is that they do not convert a collection of files and directories into a single file. The tar.gz concept on POSIX addresses this by using tar to archive a file collection into a single file and then gunzip to compress that archive.

Keeping everybody informed I have fixed biddle. Check it out now - https://github.com/prettydiff/biddle

I will republish Pretty Diff using biddle in production tomorrow. I am not ready to give it to Atom Beautify just yet though. I actually need users to play around with this thing for a bit so that I can get a sense of where the pain points are and just how bad it works for fails for other people. I wrote a getting started document at https://github.com/prettydiff/biddle/blob/master/documentation/gettingstarted.md

The documentation might be easier to read from the command line though as I included a markdown to CLI parser in biddle. The number at the end defines the word wrap limit:

node biddle markdown documentation/gettingstarted.md 80

Closing this issue as I will address resolution and further status from https://github.com/Glavin001/atom-beautify/issues/881

Was this page helpful?
0 / 5 - 0 ratings

Related issues

misterernest picture misterernest  路  3Comments

callmeyesh picture callmeyesh  路  3Comments

physcocode picture physcocode  路  3Comments

maxbrunsfeld picture maxbrunsfeld  路  4Comments

bartocc picture bartocc  路  5Comments