Page MenuHomePhabricator

Add a linter rule to prevent hardcoded class names
ClosedPublic

Authored by joshuaspence on Apr 29 2015, 12:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 1:31 AM
Unknown Object (File)
Sun, Apr 21, 7:38 PM
Unknown Object (File)
Wed, Apr 17, 10:25 PM
Unknown Object (File)
Wed, Apr 17, 10:25 PM
Unknown Object (File)
Wed, Apr 17, 10:25 PM
Unknown Object (File)
Wed, Apr 17, 10:11 PM
Unknown Object (File)
Wed, Apr 17, 9:36 PM
Unknown Object (File)
Sun, Apr 14, 6:26 AM
Subscribers

Details

Summary

Add a linter rule to advise against the use of hardcoded class names. Hardcoded class names make the code harder to refactor and it is generally preferable to use the __CLASS__ magic constant instead.

Test Plan

This works, but needs some polish.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule to prevent hardcoded class names.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
This revision is now accepted and ready to land.Apr 29 2015, 1:06 PM
joshuaspence edited edge metadata.

Use a regex for matching... this means that PhabricatorUser won't be matched in the PhabricatorUserEditor class, for example.

This revision was automatically updated to reflect the committed changes.