Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
56 lines (43 sloc) 1.44 KB

SA1116

TypeName SA1116SplitParametersMustStartOnLineAfterDeclaration
CheckId SA1116
Category Readability Rules

Cause

The parameters to a C# method or indexer call or declaration span across multiple lines, but the first parameter does not start on the line after the opening bracket.

Rule description

A violation of this rule occurs when the parameters to a method or indexer span across multiple lines, but the first parameter does not start on the line after the opening bracket. For example:

public string JoinName(string first, 
    string last)
{
}

The parameters should begin on the line after the declaration, whenever the parameter span across multiple lines:

public string JoinName(
    string first, 
    string last)
{
}

How to fix violations

To fix a violation of this rule, ensure that the first parameter starts on the line after the opening bracket, or place all parameters on the same line if the parameters are not too long.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1116:SplitParametersMustStartOnLineAfterDeclaration", Justification = "Reviewed.")]
#pragma warning disable SA1116 // SplitParametersMustStartOnLineAfterDeclaration
#pragma warning restore SA1116 // SplitParametersMustStartOnLineAfterDeclaration
You can’t perform that action at this time.