Skip to content

Commit

Permalink
Require trailing commas in multi-line Arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewnicols committed Sep 17, 2023
1 parent 9292e56 commit 0019f1f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
3 changes: 0 additions & 3 deletions moodle-extra/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@
<!-- Detect duplicate array keys -->
<rule ref="Universal.Arrays.DuplicateArrayKey"/>

<!-- Require a comma after the last element in a multi-line array, but prevent in a single-line array definition -->
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>

<!-- Disallow use of list() instead of [] -->
<rule ref="Universal.Lists.DisallowLongListSyntax"/>

Expand Down
12 changes: 12 additions & 0 deletions moodle/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@
<type>warning</type>
</rule>

<!--
Trailing commas in multi-line Arrays.
Agreed in MDLSITE-5873 on 21 May 2020.
Affects all major branches since Moodle 3.9.
Require a comma after the last element in a multi-line array, but prevent in a single-line array definition
-->
<rule ref="NormalizedArrays.Arrays.CommaAfterLast"/>

<rule ref="Generic.Classes.DuplicateClassName"/>
<rule ref="Generic.Classes.OpeningBraceSameLine"/>

Expand Down Expand Up @@ -90,6 +100,8 @@

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



<!-- Disable this exact error unless it's approved -->
<rule ref="moodle.Commenting.InlineComment.SpacingAfter">
<severity>0</severity>
Expand Down

0 comments on commit 0019f1f

Please sign in to comment.