Clarify which .editorconfig options are supported
See original GitHub issueDocumentation says:
The dotnet-format global tool supports the core set of EditorConfig options* as well as the .NET coding convention settings for EditorConfig.
I tried setting csharp_new_line_before_members_in_object_initializers = true
and it did nothing. Documentation is here.
I tried to look into source code but found only whitespace, newline, usings, etc formatters. So does this tool support codestyle rules defined by microsoft? Or does it rely on analyzers installed from SDK/NuGet? (maybe i misunderstand some concepts here…)
Project targets aspnetcore 2.2
SDKs i have installed: 2.2, 3.1, 5.0
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
EditorConfig | IntelliJ IDEA Documentation
IntelliJ IDEA allows you to manage all code style settings for each individual set of files with EditorConfig support.
Read more >EditorConfig settings - Visual Studio (Windows)
EditorConfig settings are supported by many code editors and IDEs, including Visual Studio. It's a portable component that travels with your ...
Read more >Use EditorConfig | ReSharper Documentation
EditorConfig is a configuration file convention that is used to define and maintain consistent code styles between team members working on ...
Read more >Configuration files for code analysis rules - .NET
EditorConfig options apply only to source files in a project or directory. Files that are included in a project as AdditionalFiles are not ......
Read more >Why You Should Use EditorConfig to Standardize Code ...
You use EditorConfig to define formatting conventions for textual files in a project. It's great because it's widely supported, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sharwell Since you have a better understanding of the formatting options here, Is there an existing combination of options that achieves the desired formatting?
I am sorry to ask more questions, i just have no idea where to find people who actually understand behavior of these rules (please point me if there’s any sort of community)… I swear i have read all docs but can’t figure out how to tune rule combinations properly.
Is it possible to achieve this formatting?
{ get; set;}
are on a single lineOptions i tried:
csharp_new_line_before_open_brace
seems irrelevant because it only affects{
placement, not split-block-into-newlines behavior.csharp_preserve_single_line_blocks = true
only ignores blocks if they are on a single line, so there is no way to formatvar bad_formatting1
?csharp_new_line_before_members_in_object_initializers
works as you said, fixingvar bad_formatting2
.editorconfig combinations:
So, the first question: is there any way to enforce style like
Good
property andgood_formatting
initializer from example above?Second question: formatter seems to be OK with this existing together, am i missing something?