Update erlang format for OTP24 (#3823)

Erlang's erlc error format includes the column in OTP24.
See https://blog.erlang.org/My-OTP-24-Highlights/#column-number-in-warnings-and-errors
This commit is contained in:
Jose Maria Perez Ramos
2021-07-17 14:51:17 +02:00
committed by GitHub
parent 1893abdb19
commit a6a8131306
2 changed files with 25 additions and 3 deletions

View File

@@ -38,3 +38,25 @@ Execute(The command should accept configured options.):
\ g:matched,
\ -1,
\ 'Command error: expected [' . g:cmd . '] to match [' . g:regex . ']'
Execute(Linter should recognize OTP23 format.):
let g:lines = ["t.erl:6: only association operators '=>' are allowed in map construction"]
let g:output_text = ale_linters#erlang#erlc#Handle(bufnr(''), g:lines)[0].text
let g:expected = "only association operators '=>' are allowed in map construction"
AssertEqual
\ g:output_text,
\ g:expected,
\ 'Command error: expected [' . g:output_text . '] to match [' . g:expected . ']'
Execute(Linter should recognize OTP24 format.):
let g:lines = ["t.erl:6:16: only association operators '=>' are allowed in map construction",
\ "% 6| #{ a => A, b := B }.",
\ "% | ^"]
let g:output_text = ale_linters#erlang#erlc#Handle(bufnr(''), g:lines)[0].text
let g:expected = "only association operators '=>' are allowed in map construction"
AssertEqual
\ g:output_text,
\ g:expected,
\ 'Command error: expected [' . g:output_text . '] to match [' . g:expected . ']'