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
Unknown Object (File)
Mon, Dec 9, 1:19 PM
Unknown Object (File)
Thu, Dec 5, 12:35 PM
Unknown Object (File)
Wed, Nov 27, 2:48 AM
Unknown Object (File)
Fri, Nov 22, 11:31 PM
Unknown Object (File)
Tue, Nov 19, 2:37 AM
Unknown Object (File)
Tue, Nov 12, 11:41 AM
Unknown Object (File)
Tue, Nov 12, 3:59 AM
Unknown Object (File)
Nov 9 2024, 12:51 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.