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
F15506157: D12605.diff
Tue, Apr 15, 8:58 AM
F15503553: D12605.diff
Mon, Apr 14, 10:42 AM
F15501934: D12605.id30269.diff
Sun, Apr 13, 10:14 PM
F15458839: D12605.id30804.diff
Mon, Mar 31, 7:49 AM
F15452671: D12605.id.diff
Sat, Mar 29, 6:36 AM
F15452613: D12605.diff
Sat, Mar 29, 6:18 AM
F15449929: D12605.id30804.diff
Fri, Mar 28, 12:59 PM
F15430308: D12605.id30269.diff
Mon, Mar 24, 6:59 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.