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

CA1806 never produces a diagnostic #1845

Closed
AArnott opened this issue Oct 7, 2018 · 3 comments
Closed

CA1806 never produces a diagnostic #1845

AArnott opened this issue Oct 7, 2018 · 3 comments

Comments

@AArnott
Copy link
Contributor

AArnott commented Oct 7, 2018

Analyzer package

Microsoft.Maintainability.Analyzers

Package Version

v1.2.0-beta2

Diagnostic ID

CA1806

Repro steps

class Program
{
    [Pure]
    static int Foo() => 5;
  
    static void Main()
    {
        Foo();
    }
}

Expected behavior

A CA1806 diagnostic produced on the invocation of Foo().

Actual behavior

No diagnostic.

While [Pure] methods aren't explicitly called out in the documentation for this rule, I believe it should be considered just like the other scenarios that are listed. It looks like the [Pure] support is tracked by #746 (comment)

I tried some of the other ones listed in the docs and they too did not produce any diagnostic.

jongleur1983 added a commit to jongleur1983/roslyn-analyzers that referenced this issue Oct 12, 2018
- support multiple Diagnostics in fixer (thanks for more information from @sharwell )
- use nameof for references to target elements (namespaces, classes, methods)
- improve stability by pattern matching and similar
- improve readability and maintainability by replacing the value tuple returned by GetFixComponents() by a private struct
@mavasani
Copy link
Contributor

mavasani commented Jan 1, 2019

Does not repro with latest stable version (v2.6.2) of the analyzer package.

image

@mavasani mavasani closed this as completed Jan 1, 2019
@AArnott
Copy link
Contributor Author

AArnott commented Jan 1, 2019

So I guess Microsoft.Maintainability.Analyzers is a deprecated package and I should switch to Microsoft.CodeQuality.Analyzers. Thanks.

@mavasani
Copy link
Contributor

mavasani commented Jan 1, 2019

Ah, I didn't notice you had mentioned Microsoft.Maintainability.Analyzers in the repro. Yes, that package has been deprecated since we refactored the analyzer packages for the netcore/netstandard era.

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

No branches or pull requests

2 participants