Skip to content

Enable use of clang format - #345

Draft
Chuck Walbourn (walbourn) wants to merge 2 commits into
mainfrom
clangformat
Draft

Enable use of clang format#345
Chuck Walbourn (walbourn) wants to merge 2 commits into
mainfrom
clangformat

Conversation

@walbourn

Copy link
Copy Markdown
Collaborator
  • Enable clang-format for GitHub Super Linter

  • Added clang format script: powershell -File build/Format.ps1

Local reformat has to exactly match the SuperLinter version. winget install --id=LLVM.LLVM --version 21.1.2 installs the matching version. You use powershell -File build/Format.ps1 -LLVM to use that version.

@walbourn Chuck Walbourn (walbourn) added maintenance github_actions Pull requests that update GitHub Actions code labels Sep 7, 2026
Comment thread build/Format.ps1

$sourceFiles = Get-ChildItem -LiteralPath $repoRoot -Recurse|
Where-Object {
$_.FullName -notmatch '\\(?:\.git|\.vs|build|Tests|vcpkg_installed)\\' -and $_.Extension -in '.c','.cc','.cpp','.cxx','.h','.hh','.hpp','.inl'

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

While this script works for .inl files, I am trying to figure out how to get super-linter to include .inl files as C++ files when it runs clang-format for validation.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Super-Linter doesn't have support for inl files yet, so this PR is blocked until this is addressed.

super-linter/super-linter#8110 (comment)

BeforeLambdaBody: true
SplitEmptyFunction: false
SplitEmptyRecord: false
#requires clang-format 22

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Once GitHub Super-Linter is updated to 22, I want to enable this to get the 'desired' layout of multi-line function calls. For now, the first parameter is always on the same line as the function name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider adding a Clang-Tidy configuration to enforce some coding conventions

1 participant