Page MenuHomePhabricator

Fix ArcanistPHPCloseTagXHPASTLinterRule always bailing out
ClosedPublic

Authored by asherkin on Jul 24 2017, 1:52 PM.
Tags
None
Referenced Files
F13192972: D18271.id43940.diff
Sun, May 12, 11:05 AM
Unknown Object (File)
Tue, May 7, 1:24 PM
Unknown Object (File)
Sat, May 4, 6:50 PM
Unknown Object (File)
Wed, May 1, 12:15 AM
Unknown Object (File)
Fri, Apr 19, 6:40 PM
Unknown Object (File)
Apr 2 2024, 7:44 AM
Unknown Object (File)
Apr 1 2024, 10:37 AM
Unknown Object (File)
Mar 29 2024, 11:42 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