Page MenuHomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
ClosedPublic

Authored by asherkin on Jul 24 2017, 1:52 PM.
Tags
None
Referenced Files
F14406494: D18271.diff
Mon, Dec 23, 2:45 PM
Unknown Object (File)
Sun, Dec 22, 3:52 AM
Unknown Object (File)
Sat, Dec 21, 3:12 PM
Unknown Object (File)
Sat, Dec 14, 7:50 PM
Unknown Object (File)
Mon, Dec 9, 12:46 PM
Unknown Object (File)
Thu, Nov 28, 5:19 AM
Unknown Object (File)
Tue, Nov 26, 11:47 PM
Unknown Object (File)
Nov 15 2024, 3:15 PM

Details

Summary

D13794 changed ArcanistPHPCloseTagXHPASTLinterRule to ignore inline HTML blocks, but selectDescendantsOfType returns an AASTNodeList (which always exists).

Instead, check that the count() of the node list is > 0.

empty.lint-test had to be changed, it wouldn't have been accepted had this rule not been broken before it was commited.

Added tests to cover ArcanistPHPCloseTagXHPASTLinterRule in the future.

Test Plan

arc unit

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable