-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create code formatting strategy and implementation #570
Comments
Editor config is one way to enable and disable rules and their severity to maintain consistent coding styles for everyone that works in the codebase. EditorConfig settings take precedence over global VS text editor settings. Code style rules are divided into language, unnecessary code, formatting and naming rules. There are other ways to enforce rules, like rule sets or additional configuration text files. Rules sets and EditorConfig can coexist and can both configure analyzers that are build into VS or thir pary ones. Editor config only works for VS 2019 v16.3 and later. Ways to enforce style in repos: Find the right .editorconfig to enforce style in repos My suggestion is to use the .NET runtime config: runtime/.editorconfig at main · dotnet/runtime (github.com) This is the config that is recommended to be used by most and is leveraged by other big projects. There is no concept of a "shared" editorconfig that can come from a nuget, so it will be on us to see if runtime makes changes to their config that we may want to adapt over time. A bit more verbal guidance around .net styles: runtime/coding-style.md at main · dotnet/runtime (github.com), as well as this page: C# Coding Conventions | Microsoft Learn Enforce the rules of editor config by preventing build of project or merge of PR or both. This can be done via a few ways:
Automate fixing violation of the rules of editor config both locally and in repo can be done in a few ways:
Helpful for setting up code formatting tools: runtime/code-formatting-tools.md at a526e77b6d5fbf362cd40e442a0ac893e681448f · dotnet/runtime (github.com) Tools that can be used for formatting but do not use editorconfig: |
Update on the most recent changes:
Other conclusions:
Why did this take so long:
|
Currently, formatting of the code is not fully automated. CoA and TES use ".editorconfig".
The text was updated successfully, but these errors were encountered: