GithubHelp home page GithubHelp logo

Comments (4)

dannyvv avatar dannyvv commented on July 17, 2024

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.

from msbuild.

AndyGerlicher avatar AndyGerlicher commented on July 17, 2024

Looks like they have an issue on that already. Would be great to have!
dotnet/codeformatter#79

from msbuild.

am11 avatar am11 commented on July 17, 2024

👍

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! 😎

from msbuild.

a053a avatar a053a commented on July 17, 2024

Pull request #60

from msbuild.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.