使用新发布的 csslint,我想尝试将它作为我的 .css 文件的 makefile 挂接到 vim 中。我很难让多行错误格式适用于输出。
到目前为止,我最好的结果是:
au BufRead *.css set makeprg=csslint\ %
au BufRead *.css set errorformat=%A%f:,%C%n:\ warning\ at\ line\ %l\,\ col\ %c,%C%m,%C%.%#,%C%.%#
但是,这并没有得到正确的行/列号。我在我的快速修复窗口中得到这个输出:
|| csslint: There are 33 errors and warnings in bookie.css.
||
bookie.css|| 1: warning Too many font-size declarations (13), abstraction needed.
bookie.css|| 2: warning at line 3, col 3 Rule is empty. BODY {
bookie.css|| 3: warning at line 12, col 12 Values of 0 shouldn't have units specified. padding: .5em 0em;
bookie.css|| 4: warning at line 13, col 13 Values of 0 shouldn't have units specified. margin: 0em;
...
csslint 的格式是:
csslint: There are 33 errors and warnings in bookie.css.
bookie.css:
1: warning
Too many font-size declarations (13), abstraction needed.
bookie.css:
2: warning at line 3, col 3
Rule is empty.
BODY {
有人看到我的 efm 有什么问题吗?或者有一些可能有用的东西?我试图不去编写另一个解析脚本来清理格式。谢谢您的帮助。