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
F13237141: D12605.id30269.diff
Tue, May 21, 12:37 PM
F13223271: D12605.diff
Sun, May 19, 4:26 AM
F13197979: D12605.diff
Mon, May 13, 2:37 AM
F13178125: D12605.diff
Wed, May 8, 8:12 PM
Unknown Object (File)
Thu, Apr 25, 1:31 AM
Unknown Object (File)
Apr 21 2024, 7:38 PM
Unknown Object (File)
Apr 17 2024, 10:25 PM
Unknown Object (File)
Apr 17 2024, 10:25 PM
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
Branch
master
Lint
Lint Passed
Unit
Test Failures
Build Status
Buildable 5583
Build 5602: [Placeholder Plan] Wait for 30 Seconds

Unit TestsFailed

TimeTest
1,177 msArcanistPuppetLintLinterTestCase::testLinter
306 msArcanistXMLLinterTestCase::testLinter
1,057 msArcanistCSSLintLinterTestCase::testLinter
190 msArcanistCSSLintLinterTestCase::testVersion
147 msArcanistChmodLinterTestCase::testLinter
View Full Test Results (2 Failed · 46 Passed · 5 Skipped)

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.