Page MenuHomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
ClosedPublic

Authored by asherkin on Jul 24 2017, 1:52 PM.
Tags
None
Referenced Files
F15387466: D18271.diff
Sat, Mar 15, 2:26 AM
F15361062: D18271.diff
Tue, Mar 11, 11:44 AM
F15334430: D18271.id43940.diff
Sat, Mar 8, 9:05 AM
Unknown Object (File)
Jan 27 2025, 10:35 AM
Unknown Object (File)
Jan 25 2025, 4:02 AM
Unknown Object (File)
Jan 23 2025, 3:14 PM
Unknown Object (File)
Jan 21 2025, 9:45 AM
Unknown Object (File)
Jan 20 2025, 8:12 AM

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