nats.net icon indicating copy to clipboard operation
nats.net copied to clipboard

Add .editorconfig

Open ColinSullivan1 opened this issue 3 years ago • 3 comments

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

ColinSullivan1 avatar May 07 '21 14:05 ColinSullivan1

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.

jasper-d avatar May 07 '21 16:05 jasper-d

Apologies @jasper-d , I forgot about your issue https://github.com/nats-io/nats.net/issues/352 when I opened this.

ColinSullivan1 avatar May 07 '21 16:05 ColinSullivan1

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.

danielwertheim avatar May 08 '21 07:05 danielwertheim