Enforce .NET framework naming rules
The official C# capitalization conventions define how things should be named in C#. Note that these are officially guidelines, but they are followed by virtually everyone. As such, they are the de facto standard and we should make any violation of the naming conventions an error. See:
- https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-naming-conventions?view=vs-2017
- https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference?view=vs-2017
The fact that they're official makes me inclined to just enforce, at least as a warning, maybe even as error.
As far as I can tell from the links that you've provided, they're guidelines only because C# does not have a language feature to block on improper naming and this document was not available pre version 1. This allows older code to work always, but not necessarily make it a loose rule.
As far as I can tell from the links that you've provided, they're guidelines only because C# does not have a language feature to block on improper naming
That is correct, and it is about to change (with version 3 of the Roslyn compiler). Would you prefer a warning or an error?
If it will error later, make it an error now. It will still compile but show up as error which is a nice intermediary
Well, I'm not sure it will be an error, but it will be enforceable in the future. So still an error?
Yeah. I think it makes sense. My argument is always: if it's official, there will be tooling. If there's tooling, there's official dependency on it following the guidelines.
Therefore enforce via error.
Sound reasoning. I'll do a PR.
I've looked into it, and the editors (VS/VS Code/Rider) don't currently enforce the editorconfig settings. We can revisit this once the editorconfig support has been baked into the compiler. Progress for this feature can be checked here.
I think that should help unblock this issue:
https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/overview#enable-on-build
Yeah, that looks good.