Closed sean-gilliam closed 9 years ago
If someone is willing to pick this up. We are using https://github.com/dotnet/codeformatter to format our code. The best approach would be to add support for this to the formatter and run it on our codebase. CoreFx, CoreClr, Roslyn and various other projects would benefit then too.
Looks like they have an issue on that already. Would be great to have! https://github.com/dotnet/codeformatter/issues/79
:+1:
Meanwhile, see the batch format extension: https://visualstudiogallery.msdn.microsoft.com/a7f75c34-82b4-4357-9c66-c18e32b9393e. (GH: https://github.com/yongfa365/BatchFormat)
Once installed, open VS solution, close all files, right-click solution node in Solution Explorer
and select: Batch Format > Remove and Sort Usings and Format Document
. Problem solved! :)
Also, if you have .editorconfig
in project root (https://github.com/editorconfig/editorconfig-visualstudio#readme), the BatchFormat extension will work as expected, as it calls IDE's default formatter to format the document.
Last but not the least, if you throw a .gitattributes
file (containing same formatting rules) to the root of the repo, the folks using *nix contributing to this repo will never publish C# file without CRLF, yet there won't be no dis-ambiguity. Ex: https://github.com/madskristensen/WebEssentials2015/blob/master/.gitattributes.
(hint: git does push-time formatting, so the code formatting in the repo remain consistent)
PS: now if dotnet/CodeFormatter
is able to somehow acknowledge/engage all those artifacts (by providing export/import .editorconfig/.gitattributes), that would be super rad! :sunglasses:
Pull request https://github.com/Microsoft/msbuild/pull/60
This is probably a frivolous issue, but looking at HEAD there are ~3000 unused using statements spread across >800 files spanning the project. It would be nice to clean these up a bit.
Not picking on any particular class, but lets take /src/XMakeBuildEngine/BackEnd/BuildManager/BuildRequestData.cs
This:
can be shortened to this: