1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2025-03-28 12:08:12 +01:00
phorge-arcanist/src/lint
Joshua Spence dd514e268b Modify the lint-test file format to allow for more powerful assertions
Summary:
Fixes T6854. The current format for `lint-test` files is somewhat 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`. In this diff, I extend the this format to achieve the following goals:

- Allow for the lint message code and name to be specified. Specifically, the full format is `${severity}:${line}:${char}:${code}:${name}`.
- Make all fields optional. `error:3:` will match any and all errors occuring on line 3.
- Provide more useful output when assertions fail. Specifically, output //all// lint messages that are missing and/or surplus. Previously, only the first lint message was output.

Test Plan: `arc unit`

Reviewers: #blessed_reviewers, epriestley, chad

Reviewed By: #blessed_reviewers, epriestley

Subscribers: Korvin, epriestley

Maniphest Tasks: T6854

Differential Revision: https://secure.phabricator.com/D11176
2019-05-21 13:48:30 +10:00
..
__tests__ Fix a prefix/suffix counting issue in Arcanist lint rendering 2017-09-05 13:09:46 -07:00
engine Check both UNIX- and Windows-style paths from linter output 2016-09-21 14:29:42 -07:00
linter Modify the lint-test file format to allow for more powerful assertions 2019-05-21 13:48:30 +10:00
renderer Fix some lint rendering issues when lines prior to other identical lines are removed 2017-11-01 17:18:59 -07:00
ArcanistLintMessage.php Make "line" and "char" strictly optional in ArcanistLintMessage 2017-10-17 14:30:31 -07:00
ArcanistLintPatcher.php Use phutil functions to copy/move files 2016-07-12 10:21:58 -07:00
ArcanistLintResult.php Extend from Phobject 2015-06-15 15:47:33 +10:00
ArcanistLintSeverity.php Extend from Phobject 2015-06-15 15:47:33 +10:00