finding vim efm for csslint messages - css

With the newly released csslint I wanted to try to hook it into vim as my makefile for .css files. I'm having a hard time getting the multi-line error format working for the output.
My best result so far is:
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%.%#
That doesn't get the line/column numbers right though. I'm getting this output in my quickfix window:
|| 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;
...
The format from csslint is:
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 {
Anyone see what's wrong with my efm? Or have something that might work? I'm trying not to go the route of writing another parse script to clean up the format. Thanks for the help.

You need to use a double backslash to escape commas in Vim's errorformat.

I just commited a CSS syntax-checker to Syntastic plugin, using CSS Lint. Just fetch the latest Syntastic version from GitHub, and install CSS Lint CLI tool, and you'll be on your way.
Please note that CSS Lint's warning/error format is pretty incosistent, but the plugin I wrote handles it pretty well. I expect it to improve in the future.

Working with vim's errorformat is a veritable nightmare. Usually I re-write lint output in shell for vim, though with the --format=compact switch it's thankfully workable.
set makeprg=csslint\ --format=compact\ %
set errorformat=%f:\ line\ %l\\,\ col\ \%c\\,\ %m
Source: https://github.com/kaihendry/vim-html5/blob/master/ftplugin/css.vim

Related

getting "Module build failed (from ./node_modules/sass-loader/dist/cjs.js): SassError: Invalid CSS after " in angular ag-grid

I'm getting following error after even with node-sass, sass or without both of them. But i remove node modules and node cache clean, I'm still getting this error. I tried adding node-sass and sass versions also. but still this error keep coming. this was happened after I upgrade my ag-grid version to 27.3 from 23.4.
ERROR in ./src/styles.scss (./node_modules/css-loader/dist/cjs.js??ref--13-1!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/dist/cjs.js??ref--13-3!./src/styles.scss)
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
SassError: Invalid CSS after " #return math": expected expression (e.g. 1px, bold), was ".div($lhs, $rhs);"
on line 315 of node_modules/ag-grid-community/src/styles/mixins/_ag-theme-params.scss
from line 1 of node_modules/ag-grid-community/src/styles/ag-theme-base/sass/_ag-theme-base-default-params.scss
from line 1 of node_modules/ag-grid-community/src/styles/ag-theme-base/sass/_ag-theme-base-mixin.scss
from line 1 of node_modules/ag-grid-community/src/styles/ag-theme-base/sass/_ag-theme-base.scss
from line 1 of node_modules/ag-grid-community/src/styles/ag-theme-alpine/sass/_ag-theme-alpine-mixin.scss
from line 2 of D:\Projects\Operative\Repo\ag-grid-update\finance\finance-frontend\src\styles.scss
>> #return math.div($lhs, $rhs);
----------------^
need a help because I tried so many posted answers in SO.
As of Version 26 of AG Grid, Node-Sass will no longer work with AG Grid.
This is due to Node-Sass being deprecated in favor of Dart-Sass, you can find out more about this here.
For users upgrading from versions of AG Grid before 26 or new users, we would highly recommend using Sass.
For more information regarding AG Grid and Sass and how themes and styles work, please visit our documentation.

PostCSS won't complie SCSS due to indentation?

First time using this set up, but I can't seem to figured out why the .scss file won't compile after I add any styles.
I added
.test { color: #fff; }
And you can see in cmd line that it's not compiling, but I can't seem to figure out what it wants me to do.
ERROR in src/stylesheets/styles.scss
3:5 ✖ Expected indentation of
2 spaces indentation
4:1 ✖
Unexpected missing end-of-source newline
no-missing-end-of-source-newline
cmd line screenshot
It appears to be asking for a 2 space indentation, you have either 4 spaces or a tab, so change that to 2 spaces and it also seems to be asking for a line feed at the end and you have none, so just add one of those and try again.
It just needed one more extra line to be left as seen below

Spec not allow body (remove in gpr file) without touching source files

I got the following error wich is common with generated sources:
spec of this package does not allow a body
I would like to know if it exist a rule to put in the gpr file to ignore this error.
Like a ignore flag.
As I mentionned this files are generated so i have no right on them (not alowed to suppress them neither rewrite them).
More over it would be nice to have a rule that work for every generation.
If you were to compile
package Guillaume is
end Guillaume;
package body Guillaume is
end Guillaume;
in Ada 1983 mode, you would get e.g.
gnatmake -gnat83 guillaume.ads
gcc -c -gnat83 guillaume.ads
guillaume.ada:1:09: warning: package "Guillaume" does not require a body
guillaume.ada:1:09: warning: body in file "guillaume.adb" will be ignored
Having a body that isn’t required by the spec was made illegal with Ada 95 (it would be possible to change a body and for the compilation process not to notice that it needed to be recompiled, leading to confusion). If your code generator was designed to produce Ada 83, then I guess you may have to face compiling in Ada 83 mode - but GNAT doesn’t, as far as I know, guarantee to be 100% compatible, particularly as far as the run time system is concerned.
Are the offending package bodies all actually empty? If so, you might be able to list them and use the Excluded_Source_List_File attribute in your project. If not, you are in trouble, because there’s no way (without changing package sources) to get the code in them to execute.
(Later): actually, Excluded_Source_List_File doesn’t help; it stops gprbuild looking at the file, but not the compiler; and it’s the compiler that rejects the body. Sorry. But if you could make such a list you could use it to delete the bad bodies.
You can exclude the body from the list of source files:
for Excluded_Source_Files use ("my_body.adb");

Increase maxTokensPerLine in Atom.IO

How can I increase maxTokensPerLine in my own Atom.IO environment?
I've got some long lines causing syntax to not be recognized properly, for example not highlighted correctly and brackets not taken note of etc.
But this seems to be a current source containing it. It seems to be taken as a parameter which suggests it could be configurable?
grammar-registry.coffee
I found
this.maxTokensPerLine = (_ref1 = options.maxTokensPerLine) != null ? _ref1 : Infinity;
on line 22 of /usr/share/atom/resources/app/apm/node_modules/first-mate/lib/grammar-registry.js
maxTokensPerLine also appears in
/usr/share/atom/resources/app/apm/node_modules/first-mate/lib/grammar.js
I tried adding maxTokensPerLine: 1000 in config.cson under *, core and editor, but it had no effect.
(old) maxTokensPerLine
syntax.coffee
You can use the package grammar-token-limit, which will handle changing it for you. All you need to do is specify which value you want in the package settings.
I guess if you want to do it yourself, this package would be the place to start looking.

VS Error: Octal escape sequences are only supported in ECMAScript 3 compatibility mode

I have twitter bootstrap setup to build in a new project, but am getting the following error from VS2010.
Fatal error, cannot continue: Octal escape sequences are only supported in ECMAScript 3 compatibility mode.
Which seems to be related to the following CSS/Less entry in bootstrap (type.less)...
blockquote small:before {
content: '\2014 \00A0';
}
Can anyone help?
Just wanted to say that I had this error too, and the problem for me ended up being with Chirpy. I tried to make a merged css file with it, but i was using .min files and i didn't use the chripy Minify="false" parameter in my File node. Added that parameter and that fixed it right up

Resources