Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SA1118: ParameterMustNotSpanMultipleLines with nested constructor #2200

Closed
JohanLarsson opened this issue Sep 12, 2016 · 2 comments
Closed
Assignees
Milestone

Comments

@JohanLarsson
Copy link

JohanLarsson commented Sep 12, 2016

In WPF it is pretty common to write:

public static readonly DependencyProperty BarProperty = DependencyProperty.Register(
    nameof(Bar),
    typeof(bool),
    typeof(Foo),
    new FrameworkPropertyMetadata(
        default(bool),
        FrameworkPropertyMetadataOptions.BindsTwoWayByDefault | FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsArrange,
        OnFooChanged,
        OnFooCoerce),
    OnFooValidate);

Rule 1118 does not like indenting the parameters of the nested constructor like this.
Putting the constructor of FrameworkPropertyMetadata on one long row mutes the message.

@sharwell
Copy link
Member

I believe our intent was for this to be covered by #1597, but it appears to have been omitted. Marking as a bug based on this.

@bjornhellander
Copy link
Contributor

I can have a look at this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants