SergeyTeplyakov / ErrorProne.NET

Set of roslyn-based analyzers for catching common C# errors (inspired by Google's error-prone)
MIT License
869 stars 43 forks source link

Do not emit certain diagnostics if the fix is not available in the currently used C# version #247

Closed SergeyTeplyakov closed 5 months ago

SergeyTeplyakov commented 2 years ago

For instance, if the application uses C# 7.2, do not emit a warning that a method can be made readonly, because the fix will produce a non-compilable code.

Consider emitting an info level diagnostic that will show that some diagnostics (with a name) will be available if the target language will be changed. This can be a useful hint for the user.

SergeyTeplyakov commented 5 months ago

This is applicable to structs and I don't think I'm going to heavily invest there.