forked from mirror/_s
🔧 PHPCS: add configuration for array double arrow alignment
This configuration makes the sniff less finicky when all array items are multi-line. It allow allows for cleaner diffs as an array will not need to be reformatted when the array item with the largest key has been removed. Refs: * https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-for-new-lines * https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-allow-non-exact-alignment * https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Customizable-sniff-properties#array-alignment-maximum-column
This commit is contained in:
parent
9ff286964b
commit
60071168e5
|
@ -75,6 +75,17 @@
|
||||||
as set in the "Requires at least" tag in the readme.txt file. -->
|
as set in the "Requires at least" tag in the readme.txt file. -->
|
||||||
<config name="minimum_supported_wp_version" value="4.5"/>
|
<config name="minimum_supported_wp_version" value="4.5"/>
|
||||||
|
|
||||||
|
<rule ref="WordPress.Arrays.MultipleStatementAlignment">
|
||||||
|
<properties>
|
||||||
|
<!-- No need to adjust alignment of large arrays when the item with the largest key is removed. -->
|
||||||
|
<property name="exact" value="false"/>
|
||||||
|
<!-- Don't align multi-line items if ALL items in the array are multi-line. -->
|
||||||
|
<property name="alignMultilineItems" value="!=100"/>
|
||||||
|
<!-- Array assignment operator should always be on the same line as the array key. -->
|
||||||
|
<property name="ignoreNewlines" value="false"/>
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
|
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
#############################################################################
|
#############################################################################
|
||||||
|
|
Reference in New Issue