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

Consider enabling strict roslyn setting #3645

Closed
aspnet-hello opened this issue Oct 17, 2018 · 8 comments
Closed

Consider enabling strict roslyn setting #3645

aspnet-hello opened this issue Oct 17, 2018 · 8 comments
Assignees
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework

Comments

@aspnet-hello
Copy link

From @pakrym on Sunday, July 29, 2018 7:59:29 PM

See: dotnet/corefx#31457

cc @natemcmaster @davidfowl @Eilon

Copied from original issue: aspnet/Universe#1285

@aspnet-hello
Copy link
Author

From @Eilon on Sunday, July 29, 2018 9:41:27 PM

@pakrym - is the main place of value in Kestrel? If so, can you go ahead and run with strict temporarily just to see if there are any issues? (We'd need to fix the issues anyway if/when we enable this globally.)

@aspnet-hello aspnet-hello added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Oct 17, 2018
@aspnet-hello
Copy link
Author

From @davidfowl on Monday, July 30, 2018 9:04:07 AM

We use structs all over, there’s probably code comparing a StringValues to null elsewhere.

@aspnet-hello
Copy link
Author

From @Eilon on Monday, July 30, 2018 11:41:24 AM

OK. We can still preempt a lot of the fallout by fixing up areas where we know it'll be a disaster.

@natemcmaster
Copy link
Contributor

Triage team: let's give this a try. If there are a crazy amount of compiler errors, let's chat first before you spend too much time correcting all of them.

@divega
Copy link
Contributor

divega commented Jan 23, 2019

@natemcmaster @pakrym is there a summary somewhere of the benefits of C# strict mode? Is this something we should consider enabling for the EF Core codebase as well?

cc @bricelam @ajcvickers

@pakrym
Copy link
Contributor

pakrym commented Jan 23, 2019

It enables Roslyn diagnostics that would be a breaking change to enable by default. I wasn't able to find the exact list of diagnostics but the most useful from my experience is struct to a null comparison check.

Is this something we should consider enabling for the EF Core codebase as well?

Yes, corefx, roslyn has had it enabled for some time and it caught a couple minor bugs in AspNetCore.

You can get a rough idea which diagnostics are enabled by looking through roslyns source: https://github.com/dotnet/roslyn/search?l=C%23&q=FeatureStrictEnabled&type=

@divega
Copy link
Contributor

divega commented Jan 24, 2019

Thanks @pakrym.

@pakrym
Copy link
Contributor

pakrym commented Feb 4, 2019

Done.

@pakrym pakrym closed this as completed Feb 4, 2019
@ghost ghost locked as resolved and limited conversation to collaborators Dec 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

No branches or pull requests

4 participants