Skip to content
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

Add coding guidelines for maya-usd repository #380

Merged
merged 2 commits into from
Mar 25, 2020

Conversation

kxl-adsk
Copy link

Add document to outline c++ coding guidelines for contributions to the maya-usd project.
Clang-format, CMake and Python guidelines will follow.

@kxl-adsk kxl-adsk requested a review from mdelasa March 24, 2020 12:54
Copy link
Contributor

@mattyjams mattyjams left a comment

Choose a reason for hiding this comment

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

Just some light copy editing and small formatting suggestions, but otherwise looks great to me!

Thanks @kxl-adsk!

#include <mayaUsd/nodes/stageData.h>
```

Private project’s header files should be `#include`'d using the file name when in the same folder. Private headers may live in sub-directories, but they should never included using "._" or ".._" as part of a relative paths. For example:
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing word: "should never be included"

```

### Cross-platform development
* Consult the [build.md](https://github.com/Autodesk/maya-usd/blob/dev/doc/build.md) compatibility table to ensure you use the recommended tool (i.e., dcompiler, operating system, CMake, etc.) versions.
Copy link
Contributor

Choose a reason for hiding this comment

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

Typo: compiler ("dcompiler")

Comment on lines 201 to 207
* MAYA_API_VERSION is the consistent macro to test Maya version (MAYA_APP_VERSION * 10000 + MAJOR_VERSION * 100 + MINOR_VERSION)
* MAYA_APP_VERSION is available only since Maya 2019 and is a simple year number, so it is not allowed.
**UFE**
* WANT_UFE_BUILD equals 1 if UFE is found and it should be used for conditional compilation on codes depending on UFE.

**USD**
* USD_VERSION_NUM is the macro to test USD version (USD_MAJOR_VERSION * 10000 + USD_MINOR_VERSION * 100 + USD_PATCH_VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be good to wrap all these version variable names in backticks to make them stand out a little better in the rendered text.

Comment on lines 222 to 227
* using (vs typedef) keyword
* virtual, override and final keyword
* default and delete keywords
* auto keyword
* initialization - {}
* nullptr keyword
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe wrap these C++ keywords in backticks too?

@kxl-adsk
Copy link
Author

Thank you @mattyjams. We made a pass over it before opening PR, but you manage to find a few more typos! Good job.

@kxl-adsk kxl-adsk added the documentation Improvements or additions to documentation label Mar 25, 2020
@kxl-adsk kxl-adsk merged commit 19ad33a into dev Mar 25, 2020
@kxl-adsk kxl-adsk deleted the kxl-adsk/add_coding_guidelines branch March 25, 2020 16:14
ppt-adsk pushed a commit that referenced this pull request May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants