-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Code Style - apply PascalCase #3828
Conversation
@@ -81,7 +81,7 @@ public bool grayscale | |||
/// <summary> | |||
/// The compression type to use for the sensor. | |||
/// </summary> | |||
public SensorCompressionType compression | |||
public SensorCompressionType CompressionType |
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.
I renamed a few of these to be more consistent too.
There should be some changes to the documentation I think. Otherwise looks good |
😭 Yeah, I'll do a pass on those too. |
I skimmed through code blocks, and did a few spot checks with
|
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.
❤️
@chriselion - is there any error-ing/warning/pre-commit checks we can do to defend against this in the future? |
@mmattar Nothing that I'm aware of. It sounds like something the [Coding Support Tools package] (https://docs.unity3d.com/Packages/com.unity.coding@0.1/manual/index.html) could potentially handle but not sure if it does (and we don't currently have a way to enforce anything else it does like code formatting anyway). More extreme, we could use that package to generate a dump of the API scraping and parse that. |
Followup for enforcing this automatically: https://jira.unity3d.com/browse/MLA-947 |
@chriselion Is this document publicly available by any chance? I'd be interested to have a look (I understand it's also Microsoft C# convention to go for .PascalCase for public fields, whereas I'm always used to Unity fields being .camelCase; which means Unity developers need to choose either-or, resulting in mixes). Thanks! |
@JPhilipp I'll find out - AFAIK the only version is in Unity's internal repo, but there might be a public copy somewhere. |
@JPhilipp You can install the Not exactly obvious :/ but hopefully that's enough to go on. Here's the line to add it to your list of dependencies:
|
Proposed change(s)
Unity's C# style guide says
(as opposed to UnityEngine and UnityEditor namespaces, which have different conventions).
This PR updates all the public fields and properties that I could find (via API scraper) that were camelCase instead of PascalCase
Useful links (Github issues, JIRA tickets, ML-Agents forum threads etc.)
https://ono.unity3d.com/unity-extra/unity-meta/files/@/ReferenceSource/CSharp/Assets/CSharpReference.cs
Types of change(s)
Checklist
Other comments