dense-analysis / ale

Check syntax in Vim/Neovim asynchronously and fix files, with Language Server Protocol (LSP) support
BSD 2-Clause "Simplified" License
13.57k stars 1.44k forks source link

Check ruff version for compatibility with ALE #4716

Open karolinepauls opened 9 months ago

karolinepauls commented 9 months ago

Looks like the json-lines format was added to Ruff in 2.0: https://github.com/astral-sh/ruff/commit/7b4dde0c6c95b7dfe59ef086c18539566b0df6d3

If you load vim with an updated ALE and an old ruff (e.g. ruff==0.0.269), instead of a version conflict message, you get this error:

Error detected while processing function <SNR>74_VimCloseCallback[11]..<SNR>74_VimExitCallback[22]..function <SNR>74_VimCloseCallback[11]..<SNR>74_VimExitCallback[15]..<lambda>12[1]..<SNR>69_ExitCallback[28]..<SNR>68_HandleExit[24]..ale_li
nters#python#ruff#Handle:
line    4:
E491: json decode error at 'error: invalid value 'json-lines' for '--format <FORMAT>''
Error detected while processing function <SNR>74_VimCloseCallback:
line   11:
E171: Missing :endif

It would be nice to get something like "Minimum supported ruff version is 2.0".