Page MenuHomePhabricator

Fix a false negative in lint for "xsprintf()"-family functions
ClosedPublic

Authored by epriestley on Sep 5 2020, 12:07 AM.
Tags
None
Referenced Files
F15386217: D21453.diff
Sat, Mar 15, 12:11 AM
F15345038: D21453.id51066.diff
Mon, Mar 10, 8:16 AM
F15308498: D21453.id51066.diff
Thu, Mar 6, 6:21 AM
F15302708: D21453.id.diff
Wed, Mar 5, 8:18 PM
F15291678: D21453.id51058.diff
Wed, Mar 5, 1:03 AM
Unknown Object (File)
Mon, Mar 3, 8:33 PM
Unknown Object (File)
Feb 15 2025, 5:06 PM
Unknown Object (File)
Feb 1 2025, 10:51 AM
Subscribers
None

Details

Summary

Ref T13577. This lint rule correctly detects the error in pht('x %s y') but the narrow test for n_STRING_SCALAR prevents it from detecting the error in pht('x %s y'.'z').

Make the test broader.

Test Plan
  • Ran arc lint on HTTPSFuture.php, got a detection of the issue in T13577.
  • Added a failing test and made it pass.

Diff Detail

Repository
rARC Arcanist
Branch
linter1
Lint
Lint Passed
SeverityLocationCodeMessage
Advicesrc/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php:87XHP16TODO Comment
Unit
Tests Passed
Build Status
Buildable 24873
Build 34315: Run Core Tests
Build 34314: arc lint + arc unit

Event Timeline