I suggest you ...

Allow SuppressMessageAttribute to work types within a namespace

Right now the SuppressMessageAttribute only suppresses diagnostics against a namespace, but not the types within it.
So this:
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "CC0061", Scope = "namespace", Target = "CodeCracker.Test.Design", Justification = "No need for tests to have async sufix.")]

Would not work against types inside the "CodeCracker.Test.Design" namespace, but only if the diagnostic was on the namespace itself.
To be able to do that, we need to add a SuppressMessageAttribute to each type individually, what is error prone, ugly and demands a lot of attention.
There needs to be a way to allow for the suppression of diagnostics agains all types within a namespace. It should be a single line of code, just like the one above, but I don't want to suggest a syntax or format, and leave that to the C# team.

68 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Giovanni Bassi shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    3 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base