badsyntax/SassBeautify — pull request #62 by strille (2014-11-10 13:14:58+00:00)
Title: Whitespace and comments improvements

CSS selectors are now preceded by an empty line and comments at the end of lines are no longer pushed down to the next line.

The only way to achieve this realistically without having to modifiy sass-convert (which is another project entirely) is to fix these formatting issues with regular expressions once the result has been returned by sass-convert, but before we send the formatted text back to Sublime Text.

The regular expressions responsible for inserting newlines are quite specific, so there are most likely some additional cases where newline insertion would be desirable. But it felt better to be a bit restrictive than to have newlines being inserted where not intended.

The internal functions formatting newlines and comments have some unit tests written for them. Se tests/test.py for more details.