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
F22680994: D21453.diff
Fri, Oct 2, 2:13 AM
F22663173: D21453.id51058.diff
Thu, Oct 1, 11:10 AM
Unknown Object (File)
Aug 18 2026, 10:29 PM
Unknown Object (File)
Aug 1 2026, 7:16 PM
Unknown Object (File)
Jul 31 2026, 4:08 PM
Unknown Object (File)
Jul 12 2026, 7:50 AM
Unknown Object (File)
Jul 2 2026, 6:57 PM
Unknown Object (File)
Jun 30 2026, 12:58 PM
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