1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:27:45 +00:00

Meta: Switch to clang-format-14 as the standard formatter

Now that clang-format-14 ubuntu packages are available, it's time to
finally upgrade our clang-format version. This version brings with it
a bunch of useful features with const-placement being the most notable.
These will be enabled in the following commits.
This commit is contained in:
Idan Horowitz 2022-02-06 21:05:35 +02:00 committed by Linus Groh
parent ed9ddf79ff
commit 852ae6c195
9 changed files with 30 additions and 20 deletions

View file

@ -2,7 +2,7 @@
For low-level styling (spaces, parentheses, brace placement, etc), all code should follow the format specified in `.clang-format` in the project root.
**Important: Make sure you use `clang-format` version 11 or later!**
**Important: Make sure you use `clang-format` version 14 or later!**
This document describes the coding style used for C++ code in the Serenity Operating System project. All new code should conform to this style.

View file

@ -18,10 +18,12 @@ These instructions assume the OS installed is Ubuntu 20.04 (Focal), so they migh
### Install base dependencies
```shell
add-apt-repository ppa:canonical-server/server-backports
add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:canonical-server/server-backports
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo add-apt-repository 'deb http://apt.llvm.org/focal/ llvm-toolchain-focal-14 main'
apt update
apt install git build-essential make cmake clang-format-11 gcc-11 g++-11 libstdc++-11-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt
apt install git build-essential make cmake clang-format-14 gcc-11 g++-11 libstdc++-11-dev libgmp-dev ccache libmpfr-dev libmpc-dev ninja-build e2fsprogs qemu-utils qemu-system-i386 wabt
```
### Force usage of GCC 11
```shell

View file

@ -40,7 +40,7 @@ Qt Creator should be set up correctly now, go ahead and explore the project and
## Auto-Formatting
You can use `clang-format` to help you with the [style guide](CodingStyle.md). Before you proceed, check that you're actually using clang-format version 11, as some OSes still ship clang-format version 9 or 10 by default.
You can use `clang-format` to help you with the [style guide](CodingStyle.md). Before you proceed, check that you're actually using clang-format version 14, as some OSes will ship older clang-format versions by default.
- In QtCreator, go to "Help > About Plugins…"
- Find the `Beautifier (experimental)` row (for example, by typing `beau` into the search)