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

Apply clang-format two more times to make sure we have everything formatted #918

Merged
merged 2 commits into from
Nov 13, 2020

Conversation

kxl-adsk
Copy link

After PR #890 we still had few files that weren't fully formatted by clang-format

	modified:   lib/mayaUsd/ufe/UsdAttributes.cpp
	modified:   plugin/al/mayautils/AL/maya/event/MayaEventManager.cpp
	modified:   plugin/al/mayautils/AL/maya/event/MayaEventManager.h
	modified:   plugin/al/mayautils/AL/maya/utils/FileTranslatorOptions.cpp

For some reason, clang-format required to be applied twice to the above files (and to be precise, three times for lib/mayaUsd/ufe/UsdAttributes.cpp).

It's not something I was aware of, but luckily it's only these 4 files we missed.

@kxl-adsk kxl-adsk added the build Related to building maya-usd repository label Nov 12, 2020
@kxl-adsk kxl-adsk requested a review from seando-adsk November 12, 2020 18:14
@kxl-adsk
Copy link
Author

FYI @dgovil

MDagMessage::addInstanceRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kInstanceRemovedDagPath: /* cbi.mayaCallback =
Copy link
Author

Choose a reason for hiding this comment

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

This is pretty ugly...wasn't expecting clang-format to break it this way. Must have something to do with commented code after.

Something to remember and revisit eventually.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not put it back to what it was before and use the clang-format off/on comment?

Copy link
Author

Choose a reason for hiding this comment

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

I don't want developers to have to fallback to disabling clang-format in too many cases. We will update clang-format version at one point. This will be a good opportunity to revising some of the clang-format settings and prevent this type of formatting.

For that reason, I'm not going to use the clang-format off/on comment.

// SdfValueTypeName TexCoord2hArray, TexCoord2fArray, TexCoord2dArray;
// SdfValueTypeName TexCoord3hArray, TexCoord3fArray, TexCoord3dArray;
};
static const std::unordered_map<size_t, Ufe::Attribute::Type> sUsdTypeToUfe {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I really hate this formatting and this make it impossible to read. Can you please revert this map back to its original state before the first clang-format was applied. Then you can manually change the tabs to spaces. And add in the clang-format off/on comment so this block will remain unchanged by clang-format.

Copy link
Author

Choose a reason for hiding this comment

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

Removed dead code and fixed based on our discussion.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Much better, thanks.

MDagMessage::addInstanceRemovedDagPathCallback(bindNodeStringBoolFunc,
&cbi); */
case DagMessage::
kInstanceRemovedDagPath: /* cbi.mayaCallback =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why not put it back to what it was before and use the clang-format off/on comment?

@kxl-adsk kxl-adsk merged commit 1103f0a into dev Nov 13, 2020
@kxl-adsk kxl-adsk deleted the kxl-adsk/some_files_needed_clang_format_to_apply_twice branch November 13, 2020 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Related to building maya-usd repository
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants