2017-07-17 15:28:21 -04:00
|
|
|
Before:
|
|
|
|
runtime ale_linters/yaml/swaglint.vim
|
|
|
|
|
2017-11-15 12:21:17 -05:00
|
|
|
After:
|
|
|
|
call ale#linter#Reset()
|
|
|
|
|
2017-07-17 15:28:21 -04:00
|
|
|
Execute(The swaglint handler should parse lines correctly):
|
|
|
|
AssertEqual
|
|
|
|
\ [
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 1,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Missing required property: info',
|
|
|
|
\ 'code': 'sway_object_missing_required_property',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 6,
|
|
|
|
\ 'col': 9,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Not a valid response definition',
|
|
|
|
\ 'code': 'sway_one_of_missing',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 7,
|
|
|
|
\ 'col': 11,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Missing required property: description',
|
|
|
|
\ 'code': 'sway_object_missing_required_property',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 7,
|
|
|
|
\ 'col': 11,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Missing required property: $ref',
|
|
|
|
\ 'code': 'sway_object_missing_required_property',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 10,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Expected type string but found type integer',
|
|
|
|
\ 'code': 'sway_invalid_type',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 1,
|
|
|
|
\ 'col': 10,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'No enum match for: 2',
|
|
|
|
\ 'code': 'sway_enum_mismatch',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'E',
|
|
|
|
\ },
|
|
|
|
\ {
|
|
|
|
\ 'lnum': 14,
|
|
|
|
\ 'col': 3,
|
2017-11-19 07:46:06 -05:00
|
|
|
\ 'text': 'Definition is not used: #/definitions/Foo',
|
|
|
|
\ 'code': 'sway_unused_definition',
|
2017-07-17 15:28:21 -04:00
|
|
|
\ 'type': 'W',
|
|
|
|
\ },
|
|
|
|
\ ],
|
|
|
|
\ ale_linters#yaml#swaglint#Handle(347, [
|
|
|
|
\ 'swagger.yaml: error @ 1:1 - Missing required property: info (sway_object_missing_required_property)',
|
|
|
|
\ 'swagger.yaml: error @ 6:9 - Not a valid response definition (sway_one_of_missing)',
|
|
|
|
\ 'swagger.yaml: error @ 7:11 - Missing required property: description (sway_object_missing_required_property)',
|
|
|
|
\ 'swagger.yaml: error @ 7:11 - Missing required property: $ref (sway_object_missing_required_property)',
|
|
|
|
\ 'swagger.yaml: error @ 1:10 - Expected type string but found type integer (sway_invalid_type)',
|
|
|
|
\ 'swagger.yaml: error @ 1:10 - No enum match for: 2 (sway_enum_mismatch)',
|
|
|
|
\ 'swagger.yaml: warning @ 14:3 - Definition is not used: #/definitions/Foo (sway_unused_definition)',
|
|
|
|
\ ])
|