Page MenuHomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
ClosedPublic

Authored by asherkin on Jul 24 2017, 1:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 21, 9:45 AM
Unknown Object (File)
Mon, Jan 20, 8:12 AM
Unknown Object (File)
Fri, Jan 17, 4:27 PM
Unknown Object (File)
Tue, Jan 14, 2:01 PM
Unknown Object (File)
Wed, Jan 8, 2:35 PM
Unknown Object (File)
Dec 23 2024, 2:45 PM
Unknown Object (File)
Dec 22 2024, 3:52 AM
Unknown Object (File)
Dec 21 2024, 3:12 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