Closed dhebbeker closed 1 year ago
btw. I found a VSCode extension that lets you format your current open file in according to the .clang-format specs with only a keybord shortcut: Ctrl + Alt + F It basically overrides the builtin formatter with the clang-format call. Clang-Format
Nice! For me it worked already "out of the box", as I had the C/C++ Extension already installed. The default settings use the style configuration file already.
https://code.visualstudio.com/docs/cpp/cpp-ide https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools
Style is based on style 'Microsoft' which has the greatest resemblance with Allman indentation style, from the available predefined styles.
The style configuration can be applied by clang-format (part of LLVM) using common IDE's. For example Microsoft Visual Studio Code and Eclipse CDT support to invoke clang-format with a configurable style configuration file.
To format all files using a UNIX shell, this line can be used:
Also this adds a GitHub Action which does automatically check if the style format is matched.