Page MenuHomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
ClosedPublic

Authored by asherkin on Jul 24 2017, 1:52 PM.
Tags
None
Referenced Files
F15530422: D18271.id43940.diff
Wed, Apr 23, 3:43 AM
F15487291: D18271.id43941.diff
Thu, Apr 10, 12:57 PM
F15481459: D18271.id43940.diff
Tue, Apr 8, 8:51 PM
F15474036: D18271.id.diff
Sun, Apr 6, 4:37 AM
F15471690: D18271.diff
Sat, Apr 5, 7:26 AM
F15444214: D18271.id43940.diff
Thu, Mar 27, 8:29 AM
F15397809: D18271.id43941.diff
Mar 16 2025, 10:24 PM
F15387466: D18271.diff
Mar 15 2025, 2:26 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
Branch
fix-xhpast-close-tag-rule (branched from master)
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 17787
Build 23884: Run Core Tests
Build 23883: arc lint + arc unit