Skip to content

style: clang-format adjustments - #5500

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-clang-format
Open

lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-clang-format

Conversation

@lgritz

@lgritz lgritz commented Sep 26, 2026

Copy link
Copy Markdown
Collaborator

In the process of bumping OSL to clang-format 22, mirroring the change we made here in OIIO a few weeks back, I spent some time reconciling the differences that had accumulated between the .clang-format of the two projects.

I looked at every difference, and one at a time, I tried reformatting each project with the other's choice for that line, looking at the diffs and deciding which I actually liked better. Sometimes OIIO won, sometimes OSL. Sometimes I liked the OIIO for OIIO and OSL for OSL, despite differences in style.

Anyway, this PR is the set of changes to OIIO's .clang-format that I felt like I aesthetically preferred the results as they had been implemented in OSL.

This is a matter of taste, and not everyone will agree. You might argue that even if it's nicer, it's not worth the code churn. Fair point. But in this case, I think that there is also merit for the two projets to share a formatting style to the greatest degree possible, and to periodically synchronize their .clang-format choices.

Note that we expect this PR to fail the clang-format CI job, because this patch is JUST the changes to .clang-format, and not the reformatted code (though you can preview it by looking at the failed test CI logs), and I will post a subsequent review of the actual code format changes.

In the process of bumping OSL to clang-format 22, mirroring the change
we made here in OIIO a few weeks back, I spent some time reconciling
the differences that had accumulated between the .clang-format of the
two projects.

I looked at every difference, and one at a time, I tried reformatting
each project with the other's choice for that line, looking at the
diffs and deciding which I actually liked better. Sometimes OIIO won,
sometimes OSL. Sometimes I liked the OIIO for OIIO and OSL for OSL,
despite differences in style.

Anyway, this PR is the set of changes to OIIO's .clang-format that I
felt like I aesthetically preferred the results as they had been
implemented in OSL.

This is a matter of taste, and not everyone will agree. You might
argue that even if it's nicer, it's not worth the code churn. Fair
point.  But in this case, I think that there is also merit for the two
projets to share a formatting style to the greatest degree possible,
and to periodically synchronize their .clang-format choices.

Note that we expect this PR to fail the clang-format CI job, because
this patch is JUST the changes to .clang-format, and not the
reformatted code (though you can preview it by looking at the failed
test CI logs), and I will post a subsequent review of the actual code
format changes.

Signed-off-by: Larry Gritz <lg@larrygritz.com>
@lgritz

lgritz commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator Author

Any objections?

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.

1 participant