Page MenuHomePhabricator

Improve `ArcanistDeprecationXHPASTLinterRule` by lowercasing keys in `xhpast.deprecated.functions`
Needs ReviewPublic

Authored by thaiphv on Jan 19 2017, 10:35 PM.
Tags
None
Referenced Files
F15504058: D17232.id41703.diff
Mon, Apr 14, 3:23 PM
F15492825: D17232.id41463.diff
Sat, Apr 12, 6:43 PM
F15491716: D17232.id.diff
Sat, Apr 12, 6:44 AM
F15489389: D17232.diff
Fri, Apr 11, 8:35 AM
F15484623: D17232.id41703.diff
Wed, Apr 9, 7:16 PM
F15474993: D17232.diff
Sun, Apr 6, 2:40 PM
F15472390: D17232.id41445.diff
Sat, Apr 5, 12:56 PM
F15442586: D17232.id41703.diff
Wed, Mar 26, 11:49 PM

Details

Reviewers
joshuaspence
Group Reviewers
Blessed Reviewers
Summary

As titled, this diff improves the linter by lowercasing all the blacklisted function/method names configured in xhpast.deprecated.functions. This change allows us to declare the blacklisted items in their original case, just for look and feel purpose.

Test Plan

Run arc unit.

Diff Detail

Repository
rARC Arcanist
Branch
thai-fix-ArcanistDeprecationXHPASTLinterRule
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 15599
Build 20585: arc lint + arc unit

Event Timeline

I think you probably want to use CaseInsensitiveArray, otherwise the linter message won't exactly match xhpast.deprecated.functions.

This revision now requires changes to proceed.Jan 19 2017, 10:38 PM
thaiphv edited edge metadata.
  • Use CaseInsensitiveArray to store xhpast.deprecated.functions
  • Fix jshint.lint-test
joshuaspence added inline comments.
src/lint/linter/xhpast/rules/ArcanistDeprecationXHPASTLinterRule.php
40–45

We should probably modify the getFunctionCalls method to do this.

src/lint/linter/xhpast/rules/__tests__/deprecation/deprecated-function.lint-test
3–5

Maybe also add a function call that uses the same casing?

DeprecatedFunction();
  • Move the lowercasing logic into ArcanistXHPASTLinterRule::getFunctionCalls

Can this be reviewed again and landed?

LGTM, but we need a Blessed Reviewers to sign off on it as well.