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
F18243946: D17232.id.diff
Thu, Aug 21, 6:05 AM
F18228907: D17232.diff
Wed, Aug 20, 8:59 AM
F18094294: D17232.diff
Thu, Aug 7, 10:03 PM
F18044260: D17232.id41703.diff
Sun, Aug 3, 7:00 AM
Unknown Object (File)
Jun 17 2025, 7:25 AM
Unknown Object (File)
Jun 17 2025, 7:12 AM
Unknown Object (File)
May 5 2025, 3:32 PM
Unknown Object (File)
Apr 28 2025, 7:14 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.