ThreeMammals / Ocelot

.NET API Gateway
https://www.nuget.org/packages/Ocelot
MIT License
8.36k stars 1.64k forks source link

File-scoped namespace #1874

Closed LassazVegaz closed 9 months ago

LassazVegaz commented 9 months ago

Expected Behavior / New Feature

Change block-scoped namespaces to file-scoped namespaces

Actual Behavior / Motivation for New Feature

Increase code readability. This can be done easily by using the Code Cleanup tool in VS. For new file additions, VS can be configured to automatically add file-scoped namespaces instead of block-scope namespaces.

If this is approved, I am willing to do it.

Steps to Reproduce the Problem

N/A

Specifications

N/A

raman-m commented 9 months ago

Lasindu, Thanks for pointing attention to this issue with namespaces!

As a team, we know about this problem of namespace declaration inconsistency.

I agree, it is better to have file-scoped namespaces because each file should have single class or type as Microsoft conventions requires for C# development. We define file-scoped namespaces for a newly created .cs files. Sometime converting old files. But this issue is minor in my opinion, and as a team, we try to focus on real problems and feature development. 😉 Going to mark as minor issue...

raman-m commented 9 months ago

@ggnaegi @RaynaldM Your opinion? Will we let the contributor to change tons of files? 🤣