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)
Thu, Mar 28, 11:07 PM
Unknown Object (File)
Sat, Mar 23, 9:36 AM
Unknown Object (File)
Mar 4 2024, 11:08 PM
Unknown Object (File)
Dec 30 2023, 7:30 AM
Unknown Object (File)
Dec 27 2023, 9:31 AM
Unknown Object (File)
Dec 27 2023, 9:31 AM
Unknown Object (File)
Dec 27 2023, 9:31 AM
Unknown Object (File)
Dec 27 2023, 9:31 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.