Skip to content

Commit 5f76734

Browse files
andrewnicolsstronk7
authored andcommitted
Require trailing commas in multi-line Arrays
Fixes #25
1 parent 9292e56 commit 5f76734

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

moodle-extra/ruleset.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@
4848
<!-- Detect duplicate array keys -->
4949
<rule ref="Universal.Arrays.DuplicateArrayKey"/>
5050

51-
<!-- Require a comma after the last element in a multi-line array, but prevent in a single-line array definition -->
52-
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>
53-
5451
<!-- Disallow use of list() instead of [] -->
5552
<rule ref="Universal.Lists.DisallowLongListSyntax"/>
5653

moodle/ruleset.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@
1313
<type>warning</type>
1414
</rule>
1515

16+
<!--
17+
Trailing commas in multi-line Arrays.
18+
19+
Agreed in MDLSITE-5873 on 21 May 2020.
20+
Affects all major branches since Moodle 3.9.
21+
22+
Require a comma after the last element in a multi-line array, but prevent in a single-line array definition
23+
-->
24+
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>
25+
1626
<rule ref="Generic.Classes.DuplicateClassName"/>
1727
<rule ref="Generic.Classes.OpeningBraceSameLine"/>
1828

@@ -90,6 +100,8 @@
90100

91101
<rule ref="Zend.Files.ClosingTag"/>
92102

103+
104+
93105
<!-- Disable this exact error unless it's approved -->
94106
<rule ref="moodle.Commenting.InlineComment.SpacingAfter">
95107
<severity>0</severity>

0 commit comments

Comments
 (0)