dotnet / roslyn

The Roslyn .NET compiler provides C# and Visual Basic languages with rich code analysis APIs.
https://docs.microsoft.com/dotnet/csharp/roslyn-sdk/
MIT License
18.88k stars 4.01k forks source link

File-Scoped Namespace should always have a fix all option available #58673

Open mikadumont opened 2 years ago

mikadumont commented 2 years ago

A user should always have an option to apply a fix all for this code style to their code base.

Youssef1313 commented 2 years ago

Possibly duplicate of https://github.com/dotnet/roslyn/issues/32461.

CyrusNajmabadi commented 2 years ago

I disagree. Say you have set "file scoped namespaces are an error". Then i don't think a fix-all should be available.

We have discussed refactorings having fix-alls when appropriate (which @Youssef1313 has linked to). This should fall under this bucket IMO. We should just do that work, and then have this be part of the fallout.