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)
Fri, Jan 24, 6:11 PM
Unknown Object (File)
Thu, Jan 23, 10:06 AM
Unknown Object (File)
Thu, Jan 23, 12:05 AM
Unknown Object (File)
Tue, Jan 21, 9:56 AM
Unknown Object (File)
Sun, Jan 19, 9:33 AM
Unknown Object (File)
Wed, Jan 15, 7:35 PM
Unknown Object (File)
Dec 18 2024, 1:13 AM
Unknown Object (File)
Dec 12 2024, 10:58 AM

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.