GmodNET/GmodDotNet

[ENH] Create code styling MD

AaronJThompson opened this issue · 3 comments

Overview

As more developers join the project (hopefully I will become a contributor once work cools down), it will become increasingly difficult to maintain standardized code styling across the project, making it harder to read.

It will also be difficult to reject PR's due to code styling if there isn't a standard put in place.

Therefore I suggest we create a coding style MD (could be joined with a Best Practices MD) that we can all agree on when contributing code to the project. We can then also create code formatters based on this as well, possibly even linking it to CI so that PR's are blocked for incorrect formatting

Open to opinions on this one

@AaronJThompson Yes, we definitely need code style guidelines. I think we should also use something like FxCop to make MSBuild to automatically detect style violations on managed code.

what's about create .editorconfig?

There's tool for c#
https://github.com/dotnet/format
Uses .editorconfig
Can return non zero code for checks (--check).
Also can format code in source files.

.editorcofig can't cover the whole code styling, but already enough for things like

  • Spacing size and type
  • File encoding, line ending
  • Space trimming (excellent feature)
  • Newline insertion at end of file

Also contains many advanced settings (hope page will be in your native language)