ale icon indicating copy to clipboard operation
ale copied to clipboard

Show in loclist if linter created output but parser couldn't parse

Open msdos opened this issue 3 years ago • 2 comments

After reading a lot of issues from the project (for example https://github.com/dense-analysis/ale/issues/3401) and creating my own in https://github.com/dense-analysis/ale/issues/4184, one comment from @w0rp caught my eye:

The regular expression for parsing the flake8 errors will need to be updated. It's probably tripping up on the ECE606: in the filename, and needs to be a bit less greedy.

I was thinking if it's feasible to add a message to loclist when the linter outputs something but the parser couldn't parse. This way we know that a parser update is needed and avoid searching for bugs in vim, or in the linter itself. Something along the lines (just a suggestion):

<linter> returned output:
<<SAME OUTPUT AS ALEINFO>>
But nothing was parsed. Check if it's an environment problem or if it's the case to open an issue to update the <linter> parser.

or

<linter> returned output but nothing was parsed. Check :ALEInfo to see if it's an environment problem or if it's the case to open an issue to update the <linter> parser.

The important thing IMHO is to create a pattern (use the loclist to warn or just ALEInfo?) and keep it (since other situations like https://github.com/dense-analysis/ale/issues/4155 would be logged in a consistent manner).

msdos avatar May 05 '22 19:05 msdos

The parser works by matching a pattern so there is no way to know if nothing was returned because the parser failed or because there were no errors reported by the linter.

hsanson avatar May 06 '22 11:05 hsanson

Usually when something wrong happens with a linter, there's a message from ale itself in ALEInfo (for example, Error: the command pylama could not be found within PATH or Pipfile's [scripts])... or an exit 1 with no output.

But yeah... I know is somewhat of a chicken-egg problem.

msdos avatar May 10 '22 03:05 msdos