From bef9ad4e44eb81c16b02b2f3246c28fab8692746 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sun, 4 Dec 2022 16:32:33 +0200 Subject: [PATCH] Meta: Update all references of clang-format-14 to clang-format-15 Also, we add a section that describes how to get an updated clang-format with multiple possible options to do that. --- CONTRIBUTING.md | 2 +- Documentation/AdvancedBuildInstructions.md | 8 ++++++++ Documentation/CodingStyle.md | 2 +- Documentation/QtCreatorConfiguration.md | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 62d384ae937..47e3684a83e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -40,7 +40,7 @@ Nobody is perfect, and sometimes we mess things up. That said, here are some goo **Do:** * Write in idiomatic SerenityOS C++20, using the `AK` containers in all code. -* Conform to the project coding style found in [CodingStyle.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md). Use `clang-format` (version 14 or later) to automatically format C++ files. +* Conform to the project coding style found in [CodingStyle.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md). Use `clang-format` (version 15 or later) to automatically format C++ files. See [AdvancedBuildInstructions.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/CodingStyle.md) in Clang-format updates section to check how to acquire the tool. * Choose expressive variable, function and class names. Make it as obvious as possible what the code is doing. * Split your changes into separate, atomic commits (i.e. A commit per feature or fix, where the build, tests and the system are all functioning). * Make sure your commits are rebased on the master branch. diff --git a/Documentation/AdvancedBuildInstructions.md b/Documentation/AdvancedBuildInstructions.md index c35513dbd3d..c5bd10b4a21 100644 --- a/Documentation/AdvancedBuildInstructions.md +++ b/Documentation/AdvancedBuildInstructions.md @@ -213,3 +213,11 @@ of parallel compile tasks be setting the `MAKEJOBS` environment variable to a nu Once the build script finishes, you can use it to compile SerenityOS. Either set the `SERENITY_TOOLCHAIN` build option to `Clang` as shown [above](#cmake-build-options), or pass `Clang` as the TOOLCHAIN option to `Meta/serenity.sh`, for example: `Meta/serenity.sh run i686 Clang`. + +## Clang-format updates + +There 3 options to acquire an updated clang-format tool: +1) If you have a Debian-based (apt-based) distribution, refer to [SelfHostedRunners.md](https://github.com/SerenityOS/serenity/blob/master/Documentation/SelfHostedRunners.md) document to learn more about using the LLVM apt repositories to install the latest clang-format tool. +2) Compile using `Toolchain/BuildClang.sh` as being pointed above use the compiled `Toolchain/Local/clang/bin/clang-format` binary. +3) Compile LLVM from source as pointed [here](https://llvm.org/docs/GettingStarted.html#compiling-the-llvm-suite-source-code). + diff --git a/Documentation/CodingStyle.md b/Documentation/CodingStyle.md index 0d5c5b8baa5..fbfceac6e3a 100644 --- a/Documentation/CodingStyle.md +++ b/Documentation/CodingStyle.md @@ -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 14 or later!** +**Important: Make sure you use `clang-format` version 15 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. diff --git a/Documentation/QtCreatorConfiguration.md b/Documentation/QtCreatorConfiguration.md index ab4621c0deb..a627eb9c0be 100644 --- a/Documentation/QtCreatorConfiguration.md +++ b/Documentation/QtCreatorConfiguration.md @@ -38,7 +38,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 14, as some OSes will ship older clang-format versions 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 15, 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)