Page MenuHomePhabricator

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

Authored by epriestley on Sep 5 2020, 12:07 AM.

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 OK
SeverityLocationCodeMessage
Advicesrc/lint/linter/xhpast/rules/ArcanistFormattedStringXHPASTLinterRule.php:87XHP16TODO Comment
Unit
Unit Tests OK
Build Status
Buildable 24873
Build 34315: Run Core Tests
Build 34314: arc lint + arc unit

Event Timeline