hhast icon indicating copy to clipboard operation
hhast copied to clipboard

Add 'lint errors with context and full details' output mode

Open fredemmott opened this issue 4 years ago • 2 comments

For example, something along the lines of input file:

function foo(): void {
  for($i = 0; $i < 10; $i++) {
    await bar();
  }
}

HHAST could optionally output something like...

  function foo(): void {
    for($i = 0; $i < 10; $i++) {
>     await bar();
|     ^^^^^^^^^^^
| DontAwaitInALoop Linter:
| blah blah blah more details here
    }
  }

Even if not directly useful, it would be good to use this for the unit test non-autofix .expect files - they would be much easier to review for correctness and completeness

fredemmott avatar Feb 12 '20 00:02 fredemmott

actually, we basically have this, it's the default mode.

What's needed is to add /all/ the information that's in the JSON output to it to allow replacing the expect files

fredemmott avatar Feb 12 '20 00:02 fredemmott

also the AwaitInLoop linter intentionally overrides the default output to print out specific lines but doesn't point to the exact relevant node at each line

jjergus avatar Feb 12 '20 00:02 jjergus