Skip to content

Commit

Permalink
Build/PHPCS: improve check for superfluous whitespace in files
Browse files Browse the repository at this point in the history
Apparently PSR2 turns a couple of the superfluous whitespace checks off.
This turns these back on.

There is one additional one turned off in PSR2 which I've left alone: the check for multiple blank lines in a row.
IMO, sometimes it's useful to use two blank lines to break up code for improved readability, so I'm quite happy to leave that one turned off.
  • Loading branch information
jrfnl committed Dec 2, 2017
1 parent 514be0f commit 306e10d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
<exclude name="Squiz.ControlStructures.ControlSignature.SpaceAfterCloseBrace"/>
</rule>

<!-- PSR2 appears to ignore blank lines for superfluous whitespace and in several other places. Let's fix that. -->
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
<properties>
<property name="ignoreBlankLines" value="false"/>
</properties>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.StartFile">
<severity>5</severity>
</rule>
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace.EndFile">
<severity>5</severity>
</rule>

<!-- Use normalized array indentation. -->
<rule ref="Generic.Arrays.ArrayIndent"/>
Expand Down

0 comments on commit 306e10d

Please sign in to comment.