Skip to content

Conversation

KarthikRIyer
Copy link
Contributor

Closes #706

I've added a clang format file. This is the one from openEXR with a tiny change. The space before parentheses has been removed.

I'd also like to propose to disable brace wrapping after these declarations (these wrappinngs aren't present in the code currently so disabling them should be comfortable):

  • class
  • control-statement
  • enum
  • function
  • namespace
  • struct
  • union
  • extern block

Any thoughts or additional changes you'd like to propose?
If everyone agrees then I'll reformat the files and update the PR.

@jminor @meshula @ssteinbach @reinecke

@meshula
Copy link
Collaborator

meshula commented May 16, 2020

My preference is to disable bracewrapping. Any other opinions?

@ssteinbach
Copy link
Collaborator

My personal style preference is to match the EXR style of brace wrapping. Thats an aesthetic argument, though.

The non-aesthetic argument might be that sticking closer to EXR's style will help make ASWF projects more consistent.

If we're going to add a clang-format file, we may want to also add a unit test (similar to the python lint test) to make sure that new code is formatted with the style sheet. What do folks think about that?

@ssteinbach
Copy link
Collaborator

@KarthikRIyer
Copy link
Contributor Author

If we're going to add a clang-format file, we may want to also add a unit test (similar to the python lint test) to make sure that new code is formatted with the style sheet. What do folks think about that?

Yes, we should definitely have a test for correct formatting.

I was also thinking of the open PRs that might be based on an older commit. Rebasing them might give large and ugly conflicts. So what might be a way of handling such a situation.

There's this blog that shows how MongoDB handled the situation. But I haven't gone throught their algorithm to handle it properly yet.

@ssteinbach
Copy link
Collaborator

Open PRs will need to be rebased, but thats ok. Before we land this change, we can also make sure there aren't any large PRs left open.

@ssteinbach
Copy link
Collaborator

ssteinbach commented Jul 7, 2020

To fix the build, you need to add this file to the MANIFEST.in file. That should fix the build. Sorry about that. I think you can add it as exclude, since the .clang-format doesn't need to be installed by pip.

For example:
https://github.com/PixarAnimationStudios/OpenTimelineIO/blob/64a1ae689ae7fe7ee1047ca8e412c2844df8c9cf/MANIFEST.in#L13

Copy link
Collaborator

@meshula meshula left a comment

Choose a reason for hiding this comment

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

For review at TSC. I propose we land this.

@codecov-commenter
Copy link

Codecov Report

Merging #707 (6d1ebf7) into master (8683d44) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #707   +/-   ##
=======================================
  Coverage   85.55%   85.55%           
=======================================
  Files         192      192           
  Lines       18317    18317           
  Branches     2056     2056           
=======================================
  Hits        15672    15672           
  Misses       2119     2119           
  Partials      526      526           
Flag Coverage Δ
unittests 85.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8683d44...6d1ebf7. Read the comment docs.

@ssteinbach ssteinbach merged commit 65578cf into AcademySoftwareFoundation:master Jul 22, 2021
@KarthikRIyer KarthikRIyer deleted the ClangFormat branch July 22, 2021 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

add a clang format file
4 participants