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

Common DiagnosticId prefix for all analyzer rules #165

Closed
kirchsth opened this issue Oct 15, 2022 · 0 comments · Fixed by #168
Closed

Common DiagnosticId prefix for all analyzer rules #165

kirchsth opened this issue Oct 15, 2022 · 0 comments · Fixed by #168

Comments

@kirchsth
Copy link

Description

I added fluentassertions.analyzers to a solution (with >100 projects) that I can I fix/improve my assertions.
But based on the missing common prefix in the DiagnosticId/Code it is hard to find all fluentassertions.analyzers related messages.
E.g. all NUnit.Analyzers findings start with "NUnit####" that "code" column can be as sort criteria or "NUnit" as filter criteria in e.g. error list.

grafik

grafik

Complete minimal example reproducing the issue

Open a project with a rule violation in Visual Studio and check the DiagnosticId/code in the error view (see above)

Expected behavior:

All DiagnosticIds/Code have a direct FluentAssert relation and uses e.g. a pattern like
Fluent{TipsCategoryIdx:#}{TipsAnalyserIdxPerCategory:###}
based on the Tips is Constants.cs:

  • Fluent0000: CollectionsShouldBeEmpty
  • Fluent0001: CollectionsShouldNotBeEmpty
    ...
  • Fluent1000: DictionaryShouldContainKey

Details:

        public static class Tips
        {
            public const string Category = "FluentAssertionTips";
            public static class Collections
            {
                public const string CollectionsShouldBeEmpty = nameof(CollectionsShouldBeEmpty);
                public const string CollectionsShouldNotBeEmpty = nameof(CollectionsShouldNotBeEmpty);
...
            public static class Dictionaries
            {
                public const string DictionaryShouldContainKey = nameof(DictionaryShouldContainKey);
CollectionsShouldBeEmpty (e.g Collections = 0; CollectionsShouldBeEmpty=000)   = "Fluent0000"
CollectionsShouldNotBeEmpty (e.g Collections = 0; CollectionsShouldBeEmpty=001)   = "Fluent0001"
...
DictionaryShouldContainKey (e.g Dictionary = 1; CollectionsShouldBeEmpty=000)   = "Fluent1000"

Actual behavior:

DiagnosticId/Code contains no direct FluentAssert relation (CollectionsShouldBeEmpty, CollectionsShouldNotBeEmpty, DictionaryShouldContainKey )

Versions

  • Fluent Assertions Analyzers v. 0.17.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants