matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Make stylefmt compatible with vim-autoformat #174

Open cvle opened 8 years ago

cvle commented 8 years ago

Using stylefmt like echo "invalid-css" | stylefmt results in a an empty output with zero exit code. stylefmt should emit a best effort format or just the invalid css. This would be in line with other formatters and stylefmt could be integrated in vim-autoformat. Currently vim-stylefmt is unusable because of this too.

I am using a cumbersome workaround in my vimrc to get around this:

let g:formatdef_stylefmt = '"cat > .tmp_stylefmt && stylefmt .tmp_stylefmt && cat .tmp_stylefmt && rm .tmp_stylefmt"'
let g:formatters_css = ['stylefmt']