nats.net
nats.net copied to clipboard
Add .editorconfig
We've been getting contributions from more contributors lately. Let's add a .editorconfig
file to standardize code.
Suggestions are welcome!
See: https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/code-style-rule-options#example-editorconfig-file
CC/ @watfordgnf, @danielwertheim, @jasper-d, @scottf
Like @sixlettervariables https://github.com/nats-io/nats.net/pull/447#issuecomment-834477949 I'm using a slightly modified version of the .editorconfig from dotnet/runtime.
It uses UPPER_SNAKE_CASE for private const fields which matches about two thirds of the private consts in NATS.Client.
.editorconfig is here: https://gist.github.com/jasper-d/cb0b45d903b7b1fda3919bb4771e5cf1 Code looks like this: https://gist.github.com/jasper-d/7e410b6815fe1694301194d393d2d542
But more importantly, how do you plan to use it? Just adding an .editorconfig will add a lot of noise (i.e. squiggly underlines), but changing all code at once to adhere to it will be an absolute nightmare to review.
Apologies @jasper-d , I forgot about your issue https://github.com/nats-io/nats.net/issues/352 when I opened this.
Commented in #447, but in short. Baby steps. Doesn't have to be as the C# community expects to 100%, but could use something that already is used in the repo, e.g the naming of constants and functions. Apply some structure lengths and indentation. Then let it evolve.