Page MenuHomePhabricator

Modify the `lint-test` file format to allow for assertions against linter codes
Closed, ResolvedPublic

Description

Currently, the lint-test format is roughly as follows:

${text}
~~~~~~~~~~
${severity}:${line}:${char}
...
~~~~~~~~~~
${transformed_text}
~~~~~~~~~~
{
  "hook": "optional bool",
  "config": "optional map<string, wild>",
  "path": "optional string"
}

This file format is inflexible and does not allow us to make assertions regarding the code or name of the linter messages (of class ArcanistLintMessage) that are raised. Specifically, the ${severity}:${line}:${char} format is hardcoded in ArcanistLinterTestCase. I think that this format should be generalised, to allow the code and name to be specified as well.