Page MenuHomePhabricator

Add XHAST linter standards
ClosedPublic

Authored by joshuaspence on Aug 19 2015, 9:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Dec 21, 12:33 PM
Unknown Object (File)
Fri, Dec 20, 10:13 AM
Unknown Object (File)
Fri, Dec 20, 10:13 AM
Unknown Object (File)
Fri, Dec 20, 10:12 AM
Unknown Object (File)
Fri, Dec 20, 10:12 AM
Unknown Object (File)
Fri, Dec 20, 10:12 AM
Unknown Object (File)
Fri, Dec 20, 10:11 AM
Unknown Object (File)
Fri, Dec 20, 10:11 AM
Subscribers

Details

Summary

Ref T8742. As mentioned in D13512. This still needs some work, but looks roughly how I expect it to. Mainly, I want to move the standards stuff to the linter itself rather than the linter rule. I wanted to push this out for some initial feedback though.

Test Plan

This still needs work.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add XHAST linter standards.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

This pattern feels a little weird to me:

$standard->configure($this);

In particular, if we extend $standard in the future, calls will probably be passive getter sorts of methods: shouldX(), isYEnabled(), etc.

I'd expect this to be the same way, basically a getDefaultConfigurationValue($key), instead of having the Standard actively reconfigure the Linter. I think that makes the code a little easier to follow usually, too: you can trace the getConfigurationValue(...) call and see that it ends up in the Standard without a chance of missing the earlier active reconfiguration.

Are there reasons not to use that API? The subclasses wouldn't actually change so this is kind of a moot issue, it just felt a bit odd.

Substance of the change seems fine to me. I don't feel strongly about this and we can change it later without breaking the API, so "laziness" is also an acceptable explanation to me.

This revision now requires changes to proceed.Aug 27 2015, 11:34 AM
joshuaspence edited edge metadata.

Less awkward API

joshuaspence edited edge metadata.

Remove PSR-2 (for now)

Generalize to all linters rather than being specific to XHPAST

epriestley edited edge metadata.
This revision is now accepted and ready to land.Nov 12 2015, 6:38 PM

How do you feel about the name "linter standards"? Another option is " linter ruleset", which is borrowed from PHPCS.

I had also wondered if it makes sense for a linter standard to apply to more than one linter. For example, the phutil linter standard could configure XHPAST and text listing (not a great example because we don't configure the text linter in any way). I decided against it because that seems like the job for the lint engine, hence the supportsLinter method.

This revision was automatically updated to reflect the committed changes.