2017-07-03 11:13:01 -04:00
|
|
|
After:
|
|
|
|
unlet! g:error_lines
|
|
|
|
|
2017-04-24 17:27:18 -04:00
|
|
|
Execute (stylelint errors should be handled correctly):
|
2017-06-07 04:29:53 -04:00
|
|
|
" Stylelint includes trailing spaces for output. This needs to be taken into
|
|
|
|
" account for parsing errors.
|
2017-04-24 17:27:18 -04:00
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 108,
|
|
|
|
\ 'col': 10,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Unexpected leading zero [number-leading-zero]',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 116,
|
|
|
|
\ 'col': 20,
|
|
|
|
\ 'type': 'E',
|
|
|
|
\ 'text': 'Expected a trailing semicolon [declaration-block-trailing-semicolon]',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale#handlers#css#HandleStyleLintFormat(42, [
|
|
|
|
\ 'src/main.css',
|
2017-06-07 04:29:53 -04:00
|
|
|
\ ' 108:10 ✖ Unexpected leading zero number-leading-zero ',
|
2017-04-24 17:27:18 -04:00
|
|
|
\ ' 116:20 ✖ Expected a trailing semicolon declaration-block-trailing-semicolon',
|
|
|
|
\ ])
|
2017-07-03 11:13:01 -04:00
|
|
|
|
|
|
|
Execute (stylelint should complain when no configuration file is used):
|
|
|
|
let g:error_lines = [
|
|
|
|
\ 'Error: No configuration provided for /home/w0rp/.vim/bundle/ale/test.stylus',
|
|
|
|
\ ' at module.exports (/home/w0rp/.vim/bundle/ale/node_modules/stylelint/lib/utils/configurationError.js:8:27)',
|
|
|
|
\ ' at stylelint._fullExplorer.load.then.then.config (/home/w0rp/.vim/bundle/ale/node_modules/stylelint/lib/getConfigForFile.js:39:13)',
|
|
|
|
\]
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ [{
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'text': 'stylelint exception thrown (type :ALEDetail for more information)',
|
|
|
|
\ 'detail': join(g:error_lines, "\n"),
|
|
|
|
\ }],
|
|
|
|
\ ale#handlers#css#HandleStyleLintFormat(347, g:error_lines[:])
|