Version Used:
VS 2019 16.4.2
Steps to Reproduce:
You can enable new nullable checking for C# 8.0 with entry
<Nullable>enable</Nullable>
in your csproj file which triggers warnings. You can turn warnings into errors with:
<WarningsAsErrors>CS8600;CS8602;CS8603;CS8613;CS8601;CS8625;CS8604;CS8618</WarningsAsErrors>
the problem is, when you read this list it is hard to know by heart that switch CSXXX refers to nullable checking. And also when Roslyn will come up with some extra check you will need to update your settings.
Expected Behavior:
Please provide another value for Nullable
tag:
<Nullable>errors</Nullable>
Which would automatically report ALL issues as errors without the need to manually add this and that report to WarningsAsErrors
list.
Actual Behavior:
You need to manually specify each warning to be treated as errors -- tiresome and not very readable.
You can already do that by passing nullable
to WarningsAsErrors
(or /warnaserror:nullable
from the command-line).
Tagging @jaredpar @BillWagner: Both NoWarn
and WarnAsError
support the nullable
shorthand for the long list of nullable warnings, but it is not well documented or known at this point.
I'll add a mention to the command-line help.
What other places do you think we should document this?
I'm adding mentions of "nullable" to csc -help
message in PR https://github.com/dotnet/roslyn/issues/41605
Created a docs PR to also document on warnaserror
(PR https://github.com/dotnet/docs/pull/17094)
Added documentation for "nullable" warning set to csc -help
(in 16.6p1) and updated docs to mention it too. Closing
Most helpful comment
You can already do that by passing
nullable
toWarningsAsErrors
(or/warnaserror:nullable
from the command-line).