I need to preface this with the fact that I have not spoken to a single linter team about this, but since this involves coordinating between two different groups I need to start somewhere.
I think pretty much all of us support some linter like flake8. I think that means we have all written our own regex to parse flake8’s output. What I would like to know is who here would be interested in working with the various linter teams over in PyCQA to see if we can come up with a simple API that could be provided as an entry point by linters so editors can stop parsing stdout and instead call a Python API? That way if flake8 implemented said entry point then editors could use that API to get diagnostic details instead of parsing stdout.
But there is also a knock-on effect that if the API becomes something that people can agree to then support in our editors can occur for new/other linters as fast as they implement the API. So instead of all of us having to implement yet another regex when some new linter comes on the scene we could say instead, “if you implement this entry point we can support you immediately”. Linters get better, faster, more controlled support from us and vice-versa; win-win!
And I am purposefully not suggesting LSP here since we don’t need to be language-agnostic as the linters we all seem to care about are already written in Python (not to say that LSP implementations or some other wrapping mechanism couldn’t take advantage of this work).
Anyway, as a rep for the Python extension for VS Code I’m willing to say we are interested in this. Any other editors interested in working with the PyCQA to design such an API? If there’s enough interest, my plan would be:
- Find out which editors are interested.
- Tell PyCQA what we are thinking about doing here so they can choose to participate now or wait to see what we come up with
- Come up with a design we can all agree with here (I have already done research on editors and linters and have a draft API)
- Take the design to PyCQA.
- Resolve any requested changes.
- Profit! (South Park reference for those that aren’t familiar.)