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

Implemented SA1117 diagnostic + unit tests #1480

Merged
merged 3 commits into from
Sep 18, 2015

Conversation

Maxwe11
Copy link
Member

@Maxwe11 Maxwe11 commented Sep 14, 2015

Fixes #51

@sharwell
Copy link
Member

I've been looking forward to this! 😎

@sharwell sharwell added this to the 1.0.0 Beta 12 milestone Sep 14, 2015
@Maxwe11
Copy link
Member Author

Maxwe11 commented Sep 14, 2015

Sorry for the delay, was busy with other issues

@sharwell
Copy link
Member

No problem, so was I. 😄

@sharwell
Copy link
Member

I didn't spot any issues during my initial review. In addition, I ran it on Roslyn.sln to verify that it didn't throw any exceptions there and also looked through many reported violations to verify the results were as-expected.

I'm hoping to get a second review as well. 😄


private static readonly ImmutableArray<DiagnosticDescriptor> SupportedDiagnosticsValue =
ImmutableArray.Create(Descriptor);

/// <inheritdoc/>
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => SupportedDiagnosticsValue;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could also write

public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics { get; } =
    ImmutableArray.Create(Descriptor);

and get rid of the SupportedDiagnosticsValue field.

@vweijsters
Copy link
Contributor

I'm missing tests that validate the following valid cases are handled properly:

public void Method1(
    int arg1, int arg2, int arg3)
{
}

public void Method2(
    int arg1,
    int arg2,
    int arg3)
{
}

I also doubt that the first case is handled properly

@@ -301,7 +301,7 @@
<value>The parameters to a C# method or indexer call or declaration are not all on the same line or each on a separate line.</value>
</data>
<data name="SA1117MessageFormat" xml:space="preserve">
<value />
<value>The parameters must all be placed on the same line or alternatively, each parameter must be placed on its own line.</value>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or, alternatively,

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think it reads better without "alternativelty" at all, since "each" is repeated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@vweijsters
Copy link
Contributor

👍 Looks good to me now

@sharwell sharwell merged commit a92d65a into DotNetAnalyzers:master Sep 18, 2015
sharwell added a commit that referenced this pull request Sep 18, 2015
@Maxwe11 Maxwe11 deleted the SA1117 branch September 18, 2015 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants