New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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...
com.unity.multiplayer.mlapi/Runtime/Messaging/RpcQueue/RpcQueueProcessor.cs
Show resolved
Hide resolved
com.unity.multiplayer.mlapi/Runtime/Messaging/RpcQueue/RpcQueueProcessor.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ? |
@@ -76,7 +76,10 @@ public void NetworkSerialize(NetworkSerializer serializer) | |||
|
|||
public void SetParamTracking(int paramIndex, bool isTracking) | |||
{ | |||
if (paramIndex >= 32) return; | |||
if (paramIndex >= 32) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't warn on magic numbers ? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, bots and tools are not that clever yet :D
@wackoisgod — haha, yes it does! :)
so yeah, all of the entries in |
introducing
.editorconfig
for 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-format
tool (not by me at all, yay!) except.editorconfig
file.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.