Line length enforcement for Visual Studio and dotnet format?

Jan Tache 31 Reputation points
2022-09-14T20:28:49.933+00:00

Many other language ecosystems have coding styles or standardized formatting tools with line length enforcement. E.g:

JS/TS: Prettier
C in the Linux kernel: Convention of 80 character line length
Rust: rustfmt

The idea behind the line length limit it is that there is an ideal character/column length for legibility. For books this is around 60. 60 is too few for code; for code it is typically 80-120 characters. Visual Studio and C#/.NET doesn't have a line length format option, same as the dotnet format tool. I think this option would be great to have in Visual Studio and/or the dotnet format tool.

The benefit of having our tools enforce the line lengths makes it so teams spend less time checking/enforcing/discussing this specific style point.

What are the reasons this particular option isn't included as of now? Could this be reasonably added?

Developer technologies | Visual Studio | Other
Developer technologies | C#
0 comments No comments
{count} votes

Accepted answer
  1. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2022-09-14T22:33:03.14+00:00

    I've not used Visual Studio without Resharper for a long time but would think that word wrap could include a setting for when to wrap like Resharper.

    241206-lines.png


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.