feat: spacing and formatting rules (coding standards) - #666
Conversation
| # formatting rules | ||
| dotnet_style_qualification_for_field = false:error | ||
| dotnet_style_qualification_for_property = false:error | ||
| dotnet_style_qualification_for_method = false:error | ||
| dotnet_style_qualification_for_event = false:error | ||
| dotnet_style_predefined_type_for_locals_parameters_members = true:error | ||
| dotnet_style_predefined_type_for_member_access = true:error | ||
| dotnet_style_require_accessibility_modifiers = always:error | ||
| csharp_style_var_when_type_is_apparent = true:error | ||
| csharp_prefer_braces = true:error | ||
| csharp_using_directive_placement = outside_namespace:error |
There was a problem hiding this comment.
setting verbosity levels to "error" gives us --fix-style error ability, which basically means dotnet-format would fix them for us automatically as it did here in this PR.
NoelStephensUnity
left a comment
There was a problem hiding this comment.
After looking through the Rpc stuff a little, I found an area that had the logic of the code adjusted such that it performs differently than before. That is a little worrisome...
NoelStephensUnity
left a comment
There was a problem hiding this comment.
From what I can tell, it looks like a great addition!
|
So my primary question here :P is does this follow standard unity coding guidelines ? |
| public void SetParamTracking(int paramIndex, bool isTracking) | ||
| { | ||
| if (paramIndex >= 32) return; | ||
| if (paramIndex >= 32) |
There was a problem hiding this comment.
It doesn't warn on magic numbers ? :-)
There was a problem hiding this comment.
yeah, bots and tools are not that clever yet :D
@wackoisgod — haha, yes it does! :)
so yeah, all of the entries in |
introducing
.editorconfigfor spacing and formatting rules, based on Unity C# coding standards.this is the first part of coding standard rules, we will also have naming standards soon (WIP).
we are planning to integrate these rules into both local (git push hooks) and repo (yamato ci/cd) pipelines.
all the changes are made by
dotnet-formattool (not by me at all, yay!) except.editorconfigfile.you can run this command manually in your local environment to get the same results:
I will follow-up with naming rules, git-push hook & script and yamato config in the future under a separate PR.