diff --git a/.github/workflows/lint-code.yml b/.github/workflows/lint-code.yml index ca901dba922..8d820d7a8e8 100644 --- a/.github/workflows/lint-code.yml +++ b/.github/workflows/lint-code.yml @@ -15,7 +15,7 @@ jobs: run: | set -e - brew install curl flake8 llvm@19 ninja optipng shellcheck swift-format unzip + brew install curl flake8 llvm@20 ninja optipng shellcheck swift-format unzip # Note: gn isn't available in homebrew :( # Corresponds to https://gn.googlesource.com/gn/+/225e90c5025bf74f41dbee60d9cde4512c846fe7 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bcc95d6f8c4..3bb2ee765dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,7 +67,7 @@ Nobody is perfect, and sometimes we mess things up. That said, here are some goo **Do:** * Write in idiomatic project-style C++23, using the `AK` containers in all code. -* Conform to the project coding style found in [CodingStyle.md](https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/CodingStyle.md). Use `clang-format` (version 19) to automatically format C++ files. See [AdvancedBuildInstructions.md](https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/AdvancedBuildInstructions.md#clang-format-updates) for instructions on how to get an up-to-date version if your OS distribution does not ship clang-format-19. +* Conform to the project coding style found in [CodingStyle.md](https://github.com/LadybirdBrowser/ladybird/blob/master/Documentation/CodingStyle.md). Use `clang-format` to automatically format C++ files. * 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/CodingStyle.md b/Documentation/CodingStyle.md index e2642fb7276..874d3d46de4 100644 --- a/Documentation/CodingStyle.md +++ b/Documentation/CodingStyle.md @@ -2,7 +2,12 @@ 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 19!** +**Important: Make sure you use the correct version of `clang-format`!** + +See [lint-clang-format.sh](../Meta/lint-clang-format.sh) for the version enforced in CI. + +See [AdvancedBuildInstructions.md](AdvancedBuildInstructions.md#clang-format-updates) for instructions on how to get an +up-to-date version if your OS distribution does not ship the correct version. This document describes the coding style used for C++ code in the Ladybird Browser project. All new code should conform to this style. diff --git a/Meta/lint-clang-format.sh b/Meta/lint-clang-format.sh index 6b2478a0bcd..5b1d27ff2b5 100755 --- a/Meta/lint-clang-format.sh +++ b/Meta/lint-clang-format.sh @@ -2,7 +2,7 @@ set -e -CLANG_FORMAT_VERSION=19 +CLANG_FORMAT_VERSION=20 script_path=$(cd -P -- "$(dirname -- "$0")" && pwd -P) cd "${script_path}/.." || exit 1