Format Your C# .NET Code Automatically with DotNet Format

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ส.ค. 2024
  • Never think about fixing your code formatting again!
    In this video we will look at dotnet format which is a .NET Core global tool that gives you information about your code formatting. It can either tell you if there is formatting errors or even fix them for you automatically! This is all based on your own .editorconfig file, so you make the rules.
    Let's learn how to install and use this great tool and never thing about code formatting again.
    💝 Join this channel to get access to perks:
    th-cam.com/channels/ral.html...
    🛑 Don't forget to subscribe to my channel for more amazing content: th-cam.com/users/GeraldVerslui...
    🐦 Follow me on Twitter: / jfversluis
    🤝 Join the Discord server: / discord
    🔗 Links
    Dotnet format repo: github.com/dotnet/format
    ⏱ Timestamps
    0:00 Intro
    0:32 Dotnet Format: First Look
    3:07 Dotnet Format Hands-On
    8:48 Outro
    #dotnet #codeformatting #csharp #dotnetglobaltool #productivity #pipeline
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 7

  • @jfversluis
    @jfversluis  4 ปีที่แล้ว

    Did you know about dotnet format? Have you used it before?
    I have it now running in production where it opens a PR every day when it detects formatting errors in our codebase.

    • @gizmo3399
      @gizmo3399 4 ปีที่แล้ว +1

      I generally use Resharper for this similar purpose. Although im not sure if it fixes spaces and indents. But it definitely fixes and sorts imports.

    • @jfversluis
      @jfversluis  4 ปีที่แล้ว

      @@gizmo3399 That's a nice one! I don't know what Resharper does or does not do... I can imagine it also looks at you .editorconfig file and does some of that stuff as well

  • @sipepguru
    @sipepguru 4 ปีที่แล้ว

    I'm using format on save extension, is this something similar

    • @jfversluis
      @jfversluis  4 ปีที่แล้ว

      That would be cool! Do you have a link?

    • @sipepguru
      @sipepguru 4 ปีที่แล้ว

      @@jfversluis not on my pc, but I think it's this :. marketplace.visualstudio.com/items?itemName=WinstonFeng.FormatonSave

    • @jfversluis
      @jfversluis  4 ปีที่แล้ว

      Hm that one seems to do some custom things. I found this one: marketplace.visualstudio.com/items?itemName=mynkow.FormatdocumentonSave that does changes based on your .editorconfig file. Not sure what it uses under the hood, but since it is both based on your .editorconfig it should have the same end result anyway