VIM: how to use `let errorformat` in my specified error message format?

216 views Asked by At

The linter I'm using outputs errors in the following format:

origin:PycodestyleBear (E501):file:/Users/Virtualenv/testme.py:line:2:column:81:end_line:2:end_column:81:severity:1:severity_str:NORMAL:message:E501 line too long (164 > 80 characters)'

It is apparent that the format contains several parts:

  1. Type of bear used
  2. Error number
  3. File name
  4. line number (start)
  5. column number (start)
  6. line number (end)
  7. column number (end)
  8. Type of error message
  9. Error message itself

I'm writing the plugin of my linter for syntastic, and this is causing issues with the output string, how can I configure it to match the requirements?

I've tried let errorformat = 'L%l\\:%m' with no luck

1

There are 1 answers

3
romainl On

Looking at Coala's documentation, it looks like you can pass:

  • the --json flag to output JSON (which I hear is now supported by Syntastic),
  • or the --format flag to define your desired output format.