mhutch / MonoDevelop.MSBuildEditor

Improved MSBuild editing support
Other
224 stars 26 forks source link

file-scoped namespaces #192

Closed HakamFostok closed 6 months ago

HakamFostok commented 6 months ago

The C# namespaces are using the old style namespace, but I think they could be converted to the new file-scoped namespace.

That could increase the readability of the code.

I have experimented with that for only one project in the below PR, if this suggestion is approved, I could apply the new file-scoped names to all other projects and submit the PR.

KirillOsenkov commented 6 months ago

The problem with these types of changes is that it touches every line in the file and makes blame harder. Mikayla will need to decide whether it's worth it.

mhutch commented 6 months ago

Generally I prefer to avoid formatting-only changes as they negatively impact git blame. I'd certainly recommend using file-scoped namespaces in new files.

I'd also like to change some other whitespace to using more mainstream C# style instead of Mono style and it would make sense to combine that with the file scoped namespace changes to minimize impact on blame. However I will need to think about that some more, and would probably want to manually review all changes to make sure autoformatting didn't adversely affect any readability.

Using a .git-blame-ignore-revs file may be a solution to this, but that will need more investigation. Although it works on GitHub it doesn't work in all git tools, e.g. it's not enabled by default on the git cli.

HakamFostok commented 6 months ago

thank you for the comment, I can see your point, that could be done later. For now, I am going to close this issue, as it will be tackled later

Thank you again 🙏