How we enforce .NET coding standards to improve productivity
anthonysimmon.com
How we enforce .NET coding standards to improve productivity
1–10 of 55 posts
Re: How we enforce .NET coding standards to improve productivity
#2Re: How we enforce .NET coding standards to improve productivity
#3Title should be C# not .Net
Re: How we enforce .NET coding standards to improve productivity
#4I’m the author and owner of a similar code style/code quality package in a fairly large company and went through a very similar process, culminating with writing our own Roslyn-based analyzers to enforce various internal practices to supplant the customized configuration of the Microsoft provided analyzers. Also, we discovered that different projects need different level of analysis. We’re less strict with e.g test projects than core infrastructure. But all projects need to have the same formatting and style. That too can be easily done with one nuget using msbuild.
Re: How we enforce .NET coding standards to improve productivity
#5Re: How we enforce .NET coding standards to improve productivity
#6Re: How we enforce .NET coding standards to improve productivity
#7Re: How we enforce .NET coding standards to improve productivity
#8Re: How we enforce .NET coding standards to improve productivity
#9If you’re working in the .net ecosystem, you need to grok msbuild. Is not exactly painless or elegant, but is incredibly powerful. Creating a nuget package that applies settings and configuration files to consuming projects is the tip of a very deep iceberg. I’m the author and owner of a similar code style/code quality package in a fairly large company and went through a very similar process, culminating with writing…
That's like using a car for "traveling" 3 meters. Why not just use dotnet format + .editorconfig , they were created just for this purpose.
Re: How we enforce .NET coding standards to improve productivity
#10[deleted]
It’s definitely a tough balance to strike. I go back and forth on this myself.
Maybe the happy medium is to have everything strictly enforced in CI, relatively relaxed settings during normal dev loop builds and then perhaps a pre-commit build configuration that forces/reminds you to do one production build before pushing… (which if you miss, just means you may end up with a failed CI build to fix…)