1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
Before:
runtime ale_linters/ruby/steep.vim
After:
call ale#linter#Reset()
Execute(The steep handler should parse lines correctly):
AssertEqual
\ [
\ {
\ 'lnum': 400,
\ 'col': 18,
\ 'end_col': 45,
\ 'text': 'Method parameters are incompatible with declaration `(untyped, untyped, *untyped, **untyped) { () -> untyped } -> untyped`',
\ 'code': 'Ruby::MethodArityMismatch',
\ 'type': 'E',
\ },
\ {
\ 'lnum': 20,
\ 'col': 9,
\ 'end_col': 17,
\ 'text': 'Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ 'code': 'Ruby::MethodDefinitionMissing',
\ 'type': 'W',
\ },
\ {
\ 'lnum': 30,
\ 'col': 9,
\ 'end_col': 17,
\ 'text': 'Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ 'code': 'Ruby::MethodDefinitionMissing',
\ 'type': 'I',
\ },
\ {
\ 'lnum': 40,
\ 'col': 9,
\ 'end_col': 17,
\ 'text': 'Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ 'code': 'Ruby::MethodDefinitionMissing',
\ 'type': 'I',
\ },
\ ],
\ ale_linters#ruby#steep#HandleOutput(347, [
\ '# Type checking files:',
\ '',
\ '...............................................................................................................................F..........F.F...F.',
\ '',
\ 'lib/frobz/foobar_baz.rb:400:17: [error] Method parameters are incompatible with declaration `(untyped, untyped, *untyped, **untyped) { () -> untyped } -> untyped`',
\ '│ Diagnostic ID: Ruby::MethodArityMismatch',
\ '│',
\ '└ def frobz(obj, suffix, *args, &block)',
\ ' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~',
\ '',
\ 'lib/frobz/foobar_baz.rb:20:8: [warning] Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ '│ Diagnostic ID: Ruby::MethodDefinitionMissing',
\ '│',
\ '└ class FooBarBaz',
\ ' ~~~~~~~~~',
\ '',
\ 'lib/frobz/foobar_baz.rb:30:8: [information] Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ '│ Diagnostic ID: Ruby::MethodDefinitionMissing',
\ '│',
\ '└ class FooBarBaz',
\ ' ~~~~~~~~~',
\ '',
\ 'lib/frobz/foobar_baz.rb:40:8: [hint] Cannot find implementation of method `::Frobz::FooBarBaz#method_name`',
\ '│ Diagnostic ID: Ruby::MethodDefinitionMissing',
\ '│',
\ '└ class FooBarBaz',
\ ' ~~~~~~~~~',
\ '',
\ 'Detected 4 problems from 1 file',
\ ])
Execute(The steep handler should handle when files are checked and no offenses are found):
AssertEqual
\ [],
\ ale_linters#ruby#steep#HandleOutput(347, [
\ '# Type checking files:',
\ '',
\ '.............................................................................................................................................',
\ '',
\ 'No type error detected. 🧉',
\ ])
Execute(The steep handler should handle when no files are checked):
AssertEqual
\ [],
\ ale_linters#ruby#steep#HandleOutput(347, [
\ '# Type checking files:',
\ '',
\ '',
\ '',
\ 'No type error detected. 🧉',
\ ])
Execute(The steep handler should handle empty output):
AssertEqual [], ale_linters#ruby#steep#HandleOutput(347, [''])
AssertEqual [], ale_linters#ruby#steep#HandleOutput(347, [])
|