Closed poulad closed 1 week ago
I suggest to use it as a base and tweak it.
In particular:
dotnet_style_qualification_for_*
to false
csharp_preserve_single_line_blocks
to false
csharp_prefer_simple_default_expression = true
csharp_prefer_braces = true
Everything else seems fine.
See https://kent-boogaart.com/blog/editorconfig-reference-for-c-developers
Though I don't have a clear opinion on whether we should use warnings or errors.
As @pouladpld mentioned once - tests require explicit type specification instead of var
declaration. So it should be separate configuration for these cases.
@Tuscen I believe we should mark them as errors. However, CI checks will happen on develop
branch so a bit of messy code on feature branches(before getting to develop
) would be fine.
@Tuscen suggests StyleCop as an alternative.
@pouladpld I guess we still need editorconfig to have common editor configs like line ending and such.
@Tuscen well, we can have more than 1
could be a good example of setting codestyle https://github.com/TelegramBots/Telegram.Bot/blob/ff61b89527f493ee081a2161ff304d4941357d73/src/Telegram.Bot/Exceptions/ForbiddenExceptions/ChatNotInitiatedException.cs#L13 vs https://github.com/TelegramBots/Telegram.Bot/blob/ff61b89527f493ee081a2161ff304d4941357d73/src/Telegram.Bot/Exceptions/BadRequestExceptions/BotBlockedException.cs#L12 single line vs multiline. braces on same line vs braces on single line
No need for such discussion if there is mostly only one main programmer now. He will decide his coding style.
There are various dev envs that we use. In order to have consistency through our code, I suggest using EditorConfig.
@Tuscen suggests https://github.com/RehanSaeed/EditorConfig/blob/master/.editorconfig