Page MenuHomePhabricator

Add sniff to keep single space between closing parenthesis and opening brace of some statement
Closed, DuplicatePublic

Description

I found that there is lack of rule for the space of closing parenthesis and opening brace,such as the following.

// no space between 
if ( $a === false ){
    # code...
}

// no expected single space
if ( $a === false )  {
    # code...
}
// opening brace on the different line
if ( $a === false )
{
    # code...
}

// unnecessary empty line between opening brace and code
if ( $a === false ) {

    # code...
}
or
if ( $a === false )
{

    # code...
}

not only if statement but also while, foreach, where, catch and so on.
see changes in https://gerrit.wikimedia.org/r/#/c/275747/

Event Timeline

Lethexie created this task.Mar 9 2016, 5:07 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 9 2016, 5:07 AM
Lethexie updated the task description. (Show Details)Mar 9 2016, 5:10 AM