install.fairie/dotfiles/.vim/plugged/ale/test/handler/test_spectral_handler.vader
Git E2E Dev Test Username e149692cc9 git subrepo clone https://github.com/dense-analysis/ale.git ./dotfiles/.vim/plugged/ale
subrepo:
  subdir:   "dotfiles/.vim/plugged/ale"
  merged:   "e4b205440"
upstream:
  origin:   "https://github.com/dense-analysis/ale.git"
  branch:   "master"
  commit:   "e4b205440"
git-subrepo:
  version:  "0.4.3"
  origin:   "???"
  commit:   "???"
2022-10-18 10:37:09 -04:00

52 lines
1.6 KiB
Text

Before:
runtime ale_linters/yaml/spectral.vim
After:
call ale#linter#Reset()
Execute(spectral handler should parse lines correctly):
AssertEqual
\ [
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'code': 'oas3-api-servers',
\ 'text': 'OpenAPI `servers` must be present and non-empty array.',
\ 'type': 'W'
\ },
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'code': 'oas3-schema',
\ 'text': 'Object should have required property `paths`.',
\ 'type': 'E'
\ },
\ {
\ 'lnum': 1,
\ 'col': 1,
\ 'code': 'openapi-tags',
\ 'text': 'OpenAPI object should have non-empty `tags` array.',
\ 'type': 'W'
\ },
\ {
\ 'lnum': 3,
\ 'col': 6,
\ 'code': 'info-contact',
\ 'text': 'Info object should contain `contact` object.',
\ 'type': 'W'
\ },
\ {
\ 'lnum': 3,
\ 'col': 6,
\ 'code': 'oas3-schema',
\ 'text': '`info` property should have required property `version`.',
\ 'type': 'E'
\ },
\ ],
\ ale#handlers#spectral#HandleSpectralOutput(bufnr(''), [
\ 'openapi.yml:1:1 warning oas3-api-servers "OpenAPI `servers` must be present and non-empty array."',
\ 'openapi.yml:1:1 error oas3-schema "Object should have required property `paths`."',
\ 'openapi.yml:1:1 warning openapi-tags "OpenAPI object should have non-empty `tags` array."',
\ 'openapi.yml:3:6 warning info-contact "Info object should contain `contact` object."',
\ 'openapi.yml:3:6 error oas3-schema "`info` property should have required property `version`."',
\ ])