HomePhabricator

Split the `ArcanistXHPASTLinter` into modular rules

Description

Split the ArcanistXHPASTLinter into modular rules

Summary:
The ArcanistXHPASTLinter class is becoming quite bloated. This diff separates the class into one-class-per-rule, which makes everything much more modular. One downside to this decoupling is that code reuse between linter rules is much more difficult, although this only affects a very small number of linter rules.

There is still some further work that could be done here, but I defer this until a later diff:

  • Rewrite ArcanistPhutilXHPASTLinter using ArcanistXHPASTLinterRule.
  • Change the unit tests so that they are truly only testing a single linter rule.
  • Maybe improve the way in which linter configuration options are handled.
  • Make it easier to keep track of the linter rule IDs (see T6859).

Test Plan: arc unit

Reviewers: epriestley, Blessed Reviewers

Reviewed By: epriestley, Blessed Reviewers

Subscribers: johnny-bit, epriestley, Korvin

Differential Revision: https://secure.phabricator.com/D10541

Details

Provenance
joshuaspenceAuthored on
joshuaspencePushed on Jun 1 2015, 5:50 AM
Reviewer
Blessed Reviewers
Differential Revision
D10541: Split the `ArcanistXHPASTLinter` into modular rules
Parents
rARCcdaa0e32e473: Always return an array from ArcanistWorkflow->loadProjectRepository()
Branches
Unknown
Tags
Unknown