-
Notifications
You must be signed in to change notification settings - Fork 789
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
[WIP]Turn unused value warnings on by default #10546
Conversation
58c33f3
to
96ec5c5
Compare
This comment has been minimized.
This comment has been minimized.
96ec5c5
to
ae20dc2
Compare
Huh. So like, does |
96a6a05
to
b7e0494
Compare
…fault, and treat warnings as errors by default
The issue is that NoWarn has no effect when the warning is in WarningsAsErrors - when we use NoWarn, we add the warning to the let ReportWarningAsError options err =
warningOn err options.WarnLevel options.WarnOn &&
not (List.contains (GetDiagnosticNumber err) options.WarnAsWarn) &&
((options.GlobalWarnAsError && not (List.contains (GetDiagnosticNumber err) options.WarnOff)) ||
List.contains (GetDiagnosticNumber err) options.WarnAsError) Which, in our case evaluates to <doesnt really matter what left evaluates to> || true // Since 1182 is in WarnAsError by default via the FSharpBuild.Directory.build.props I've removed 1182 from WarningsAsErrors, since it's enabled by default now, and we treat all warnings as errors. Let me know if there are any objections. |
…2 in one of the tests
Some tests are failing, need to add some NoWarns to generated fsprojs (or fix unused vars). |
@vzarytovskii Let's discuss this
|
Yeah, the more tests I "fix", the more I think it may be not what we want to enforce via the compiler. |
Right. I mean I think it's ok for fresh project code. |
Yeah, we can enable it in the templates by default, I guess. |
I'll just close this out since it was so long ago |
Based on comment from #10457
Also worth noting that a lot of F# developers turn this one on explicitly