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

SA1500 inconsistent with original StyleCop: Declaring array field with misplaced curly brackets is not reported #2224

Closed
NikolayIT opened this issue Nov 15, 2016 · 1 comment
Assignees
Milestone

Comments

@NikolayIT
Copy link
Member

NikolayIT commented Nov 15, 2016

SA1500 rule is inconsistent with original StyleCop. When I Declare an array field with misplaced curly brackets no issues are reported.

Example code:

public class Class1
{
    private int[] array =
        { 1, 2, 3 };

    public Class1()
    {
    }
}

The original StyleCop reports SA1500 but StyleCopAnalyzers doesn't report anything.

@NikolayIT
Copy link
Member Author

Another example:

public class SomeClass
{
    private static readonly PropertyInfo[] IdentityProps =
        { typeof(SomeClass).GetTypeInfo().GetDeclaredProperty(nameof(Title)) };

    public string Title { get; set; }
}

Reported by StyleCop but not reported by StyleCopAnalyzers.

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