Skip to content

Add a clang-format workflow - #751

Merged
mcarans merged 2 commits into
OoliteProject:masterfrom
mcarans:clangformat-workflow
Sep 24, 2026
Merged

mcarans merged 2 commits into
OoliteProject:masterfrom
mcarans:clangformat-workflow

Conversation

@mcarans

@mcarans mcarans commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Looks like I missed the pure C files lol

@mcarans
mcarans marked this pull request as ready for review September 24, 2026 05:07
@mcarans

mcarans commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

Actually was just wrong clang-format version - 22 works

@mcarans
mcarans merged commit 8ffe02d into OoliteProject:master Sep 24, 2026
13 checks passed
@LW-archlinux

LW-archlinux commented Sep 24, 2026 •

Copy link
Copy Markdown

clang-format supports several styles and also allows custom ones .

Since oolite is published under the GPL license and not tied to a specific compliter or connected to one of the listed corporation styles the GNU coding style seems like a sensible choice.

As changing coding styles later tends to be a lot of work, this needs to be talked about.

@mcarans

mcarans commented Sep 24, 2026

Copy link
Copy Markdown
Contributor Author

GNU is a C/C++ style, not an Objective-C style.

@LW-archlinux

Copy link
Copy Markdown

That is not a useful answer, maybe that's because I didn't make the question clear enough .

Rephrasing

  • Which coding style does clang-format use now for oolite ?
  • Where is this style documented ?
  • Has there been a discussion about which coding style Oolite should follow ?

@mcarans

mcarans commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor Author

GNU coding style seems like a sensible choice

I was responding to this point when I said "GNU is a C/C++ style, not an Objective-C style."

As mentioned in the other PR already the style is webkit. Oolite was developed on Apple Macs in an Apple language so choosing an Apple style seemed like a no brainer to me. I assume the details of the style are available somewhere in the clang-format docs. It looks readable and clean to me as someone who has to code in the language and to understand the existing code.

The discussion was the usual with PRs ie. between submitter of PR and approver(s) of PR as well as any commenters if any problems are spotted. Once it was approved, PR was merged.

@LW-archlinux

Copy link
Copy Markdown

The process to start using clang-format seems to have started in issue #572 and spread over #745 , #748 , #749 and this PR but there never was a discussion about clang-format / style as a whole.

As for the style documentation for webkit

https://clang.llvm.org/docs/ClangFormatStyleOptions.html#configurable-format-style-options says

WebKit A style complying with [WebKit’s style guide] (https://www.webkit.org/coding/coding-style.html)

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.

3 participants