question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Format code using official dotnet-format tool

See original GitHub issue

Today I was experimenting with this SDK and regenerating code using xdrgen and I discovered that the tools I have do not format the .cs files in this repo in the same way that they are currently formatted. I tried a few tools, VSCode, dotnet-format, Visual Studio for Mac, and they didn’t format them identical.

This is not particularly problematic for code that is purely edited by hand, but since there are many files generated by XDR it is difficult to regenerate those files then format them according to the norms that I see the maintainers are using.

Would it be possible to standardize on using the official dotnet-format tool to format code? It supports configuration so it can be configured to format code in a way that is pleasing to you. It’s default formater seems pretty close, but not identical, to what is already in this repo.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
fracekcommented, Jan 24, 2021

Closing since we now check for code formatting as part of the CI process.

1reaction
elucidsoftcommented, Jan 21, 2021

using System; is usually kept.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet format command - .NET CLI
dotnet format is a code formatter that applies style preferences to a project or solution. Preferences will be read from an .editorconfig ...
Read more >
Home for the dotnet-format command
dotnet -format is a code formatter for dotnet that applies style preferences to a project or solution. Preferences will be read from an...
Read more >
Using dotnet format Command to Format the C#/.NET Code
dotnet format is a tool that was added a while ago that we can install as a standalone tool. But as it now...
Read more >
DotNet-Format vs. CSharpier: Which Auto-Formatting Tool ...
CSharpier is an opinionated code formatter for c#. It uses Roslyn to parse your code and re-print it with its rules. To install...
Read more >
Code formatting for C# projects: dotnet format + GitHub ...
To apply formatting styles consistently across C# projects you can use the global dotnet tool: dotnet-format. The dotnet-format tool relies on ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found