TelegramBots / Telegram.Bot

.NET Client for Telegram Bot API
https://telegrambots.github.io/book
MIT License
3.1k stars 680 forks source link

EditorConfig #640

Closed poulad closed 1 week ago

poulad commented 6 years ago

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

tuscen commented 6 years ago

I suggest to use it as a base and tweak it.

In particular:

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.

karb0f0s commented 6 years ago

As @pouladpld mentioned once - tests require explicit type specification instead of var declaration. So it should be separate configuration for these cases.

poulad commented 6 years ago

@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.

poulad commented 6 years ago

@Tuscen suggests StyleCop as an alternative.

tuscen commented 6 years ago

@pouladpld I guess we still need editorconfig to have common editor configs like line ending and such.

poulad commented 6 years ago

@Tuscen well, we can have more than 1

karb0f0s commented 6 years ago

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

wiz0u commented 1 week ago

No need for such discussion if there is mostly only one main programmer now. He will decide his coding style.