Skip to content

Add clang-format config tuned to KLayout C++ style#2378

Open
nikosavola wants to merge 3 commits into
KLayout:masterfrom
nikosavola:nikosavola/push-xmmumpkslyqn
Open

Add clang-format config tuned to KLayout C++ style#2378
nikosavola wants to merge 3 commits into
KLayout:masterfrom
nikosavola:nikosavola/push-xmmumpkslyqn

Conversation

@nikosavola

Copy link
Copy Markdown
Contributor

In this PR, we add a .clang-format config tuned to the existing C++ style in KLayout. Then, we also add a CI check that fails if the the codebase is not formatted. Finally, in a single commit we run clang format on all the source files.

Let me know if the clang-format file needs any fine tuning.

@nikosavola nikosavola force-pushed the nikosavola/push-xmmumpkslyqn branch 2 times, most recently from e54c2f3 to 15117db Compare June 23, 2026 08:55
Uses `jidicula/clang-format-action`
Applies the repo .clang-format to all tracked C/C++ sources except testdata (golden fixtures) and src/gsiqt (machine-emitted Qt bindings).
@nikosavola nikosavola force-pushed the nikosavola/push-xmmumpkslyqn branch from 15117db to 0c462df Compare June 23, 2026 09:44
@klayoutmatthias

Copy link
Copy Markdown
Collaborator

Hi @nikosavola,

Although the changes are fairly conservative and the style is nicely matching, it's a tough decision to merge such a commit.

Main reason is that I have a number of old branches open which I want to merge when time comes, and I don't want to drown in conflicts.

Matthias

@nikosavola

Copy link
Copy Markdown
Contributor Author

Hi @nikosavola,

Although the changes are fairly conservative and the style is nicely matching, it's a tough decision to merge such a commit.

Main reason is that I have a number of old branches open which I want to merge when time comes, and I don't want to drown in conflicts.

Matthias

Understandable. Supporting autoformatting would be nice to have. I guess it could either be introduced later or alternatively add the .clang-format config but not enforce it for everything yet in CI. Maybe format only files when they are changed?

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.

2 participants