Skip to content

feat: naming rules (coding standards) #670

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

Merged
merged 11 commits into from
Mar 30, 2021
Merged

feat: naming rules (coding standards) #670

merged 11 commits into from
Mar 30, 2021

Conversation

0xFA11
Copy link
Contributor

@0xFA11 0xFA11 commented Mar 26, 2021

Summary

continuing on .editorconfig with naming rules, based on Unity C# coding standards.
this is the second part of coding standard rules where we apply naming conventions.
we are planning to integrate these rules into both local (git push hooks) and repo (yamato ci/cd) pipelines.

all changes in this PR are made according to errors indicated by dotnet-format applying .editorconfig rules.

Running Locally

you can run this command manually in your local environment to get the same results:

$ dotnet-format ./testproject/testproject.sln --fix-whitespace --fix-style error

after running the command above:

  • source files will be formatted (hence --fix-whitespace)
  • styling issues will be fixed (hence --fix-style error)
  • naming errors will be printed as a list (if any)
  • source files will be changed but they will not be committed or pushed

dotnet-format is able to format files and fix styling issues such as spaces, brackets etc.
however, it is not capable of fixing name errors since they're strictly defined by the developer.
formatting and styling fixes are 100% safe, they will NEVER change the code-flow, behavior etc.
naming errors should be fixed by the developer according to Unity C# Standards, manually.

Notes

currently, this PR does NOT automate or touch anything in your local environment and/or over yamato remotely.

however, we are planning to integrate these rules into local development environment with git-push hook script and also over develop branch remotely by integrating it into yamato ci/cd as an extra step in the testing pipeline.

we will have discussions about these future steps with Core SDK team and I will follow-up with separate PRs.

Comment on lines 25 to 28
public string m_Name;
public string m_Category;
public string Name;
public string Category;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 36 to 40
public List<MLAPIProfilerCounter> m_ChartCounters = new List<MLAPIProfilerCounter>();
public List<MLAPIProfilerCounter> m_DetailCounters = new List<MLAPIProfilerCounter>();
public string m_Name;
public List<MLAPIProfilerCounter> ChartCounters = new List<MLAPIProfilerCounter>();
public List<MLAPIProfilerCounter> DetailCounters = new List<MLAPIProfilerCounter>();
public string Name;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This cant be done. as the comment says above it. the fields are name that way for internal serialization

Comment on lines 45 to 47
public List<MLAPIProfilerModuleData> m_Modules;
public List<MLAPIProfilerModuleData> Modules;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xFA11 0xFA11 requested a review from kvassall-unity March 26, 2021 19:36
@0xFA11 0xFA11 force-pushed the feature/naming-rules branch from 9657ea8 to 17e8b2c Compare March 29, 2021 18:43
@0xFA11 0xFA11 force-pushed the feature/naming-rules branch from def95c8 to 1b00c4a Compare March 29, 2021 18:52
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@0xFA11 0xFA11 enabled auto-merge (squash) March 29, 2021 19:52
@0xFA11 0xFA11 merged commit 142e508 into develop Mar 30, 2021
@0xFA11 0xFA11 deleted the feature/naming-rules branch March 30, 2021 03:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants