Page MenuHomePhabricator

Add SpaceBeforeControlStructureBraceSniff to enforce single space between closing parenthesis and opening brace
Closed, ResolvedPublic

Description

Add the sniff to enforcing single space between ) and { in control structure like if,elseif,while,for,switch and so on, as following:

// pass
if ( $a === false ) {
    # code...
}
// pass
switch ( $a ) {
    # code...
}

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

see https://gerrit.wikimedia.org/r/#/c/275747/

Details

Related Gerrit Patches:
mediawiki/tools/codesniffer : masterAdd the SpaceBeforeControlStructureBraceSniff

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptMar 15 2016, 11:46 AM
Aklapper renamed this task from Add the SpaceBeforeControlStructureBraceSniff for enforcing single space between closing parenthesis and opening brace to Add SpaceBeforeControlStructureBraceSniff to enforce single space between closing parenthesis and opening brace.Mar 15 2016, 12:54 PM

Change 275747 had a related patch set uploaded (by Lethexie):
Add the SpaceBeforeControlStructureBraceSniff

https://gerrit.wikimedia.org/r/275747

Change 275747 merged by jenkins-bot:
Add the SpaceBeforeControlStructureBraceSniff

https://gerrit.wikimedia.org/r/275747

Legoktm closed this task as Resolved.Dec 2 2016, 4:44 AM
Legoktm claimed this task.
Legoktm reassigned this task from Legoktm to Lethexie.
Legoktm added a subscriber: Legoktm.