2

in my vimrc file, I add this line:

let g:ale_python_pylint_options = '--rcfile ~/.pylintrc'

And in my ~/.pylintrc file, I have this line:

msg-template={msg_id}: {msg}

However, with my vim ale plugin, the error message showed does not include the mssage id.

The message is like this:

[Pylint] Unused variable 'j' [W]

But I hope I could get this: [Pylint] [W0612] Unused variable 'j' [W]

How could I make it work?

Rob Bednark
  • 25,981
  • 23
  • 80
  • 125
coin cheung
  • 949
  • 2
  • 10
  • 25

1 Answers1

2

You could do that using the g:ale_echo_msg_format option. For example, setting this option in the vimrc as shown below, would give you the desired result:

let g:ale_echo_msg_format='[%linter%] [%severity%] %code% %s'

Where code is the error code. However, this code outputted is a human-readable code instead of the actual code. For the above an example output is as follows:

[pylint] [Warning] missing-docstring Missing module docstring                                                                                                       

Note missing-docstring instead of the code F0001. On reading through the issues, the author of ale is deliberately doing this, So, if you need the actual error code, you're out of luck. Open an issue in the project and hope the author changes this behavior.

Harish
  • 1,433
  • 9
  • 21
  • I thought maybe I could have both the readable code and the read code, but it seems that I could not have it right now from you description. Maybe I could do it in the future. – coin cheung Apr 02 '19 at 02:44