Page MenuHomePhabricator

New rule: `catch` should not be on its own line
Closed, ResolvedPublic

Description

catch should go on the same line as the preceding } from either try or an earlier catch
See https://gerrit.wikimedia.org/r/q/topic:start-catch for manual fixes

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Change 840632 had a related patch set uploaded (by Majavah; author: Majavah):

[mediawiki/tools/codesniffer@master] New sniff: MediaWiki.WhiteSpace.SameLineCatch

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

Change 840632 merged by jenkins-bot:

[mediawiki/tools/codesniffer@master] New sniff: MediaWiki.WhiteSpace.SameLineCatch

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

finally can be used in the same way, but it is not part of the sniff (and its name), same for try

try
{
   // do something
}
finally
{
   // do something other
}

Change 910038 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/tools/codesniffer@master] Enable Squiz.ControlStructures.ControlSignature

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

Change 910038 merged by jenkins-bot:

[mediawiki/tools/codesniffer@master] Enable Squiz.ControlStructures.ControlSignature

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