diff --git a/.clang-format b/.clang-format index e29c658c72c..ff2c1150453 100644 --- a/.clang-format +++ b/.clang-format @@ -7,6 +7,7 @@ AlignConsecutiveDeclarations: false AlignEscapedNewlines: DontAlign AlignOperands: true AlignTrailingComments: false +AllowAllConstructorInitializersOnNextLine: false AllowAllParametersOfDeclarationOnNextLine: true AllowShortBlocksOnASingleLine: false AllowShortCaseLabelsOnASingleLine: false diff --git a/CMakeLists.txt b/CMakeLists.txt index 505bcfd79b4..5b4cf09c947 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -216,7 +216,7 @@ set(required_buildtools FlatC # Optional build tools set(optional_buildtools CCache - ClangFormat + ClangFormat>=9.0 ClangTidy Cppcheck IncludeWhatYouUse) @@ -292,7 +292,7 @@ core_optional_dep(${optional_deps}) core_require_dep(${required_deps}) # Check for any libs to be packaged with main app. eg libaacs -# These libs are not directly linked with main app, but may be used if available from a +# These libs are not directly linked with main app, but may be used if available from a # dependency in the main app. eg libbluray can dyload libaacs for additional features if(PLATFORM_OPTIONAL_PACKAGES) core_optional_package_lib(${PLATFORM_OPTIONAL_PACKAGES}) diff --git a/docs/CODE_GUIDELINES.md b/docs/CODE_GUIDELINES.md index d3d190d039e..70aec6f8887 100644 --- a/docs/CODE_GUIDELINES.md +++ b/docs/CODE_GUIDELINES.md @@ -65,7 +65,7 @@ ## 1. Motivation When working in a large group, the two most important values are readability and maintainability. We code for other people, not computers. To accomplish these goals, we have created a unified set of code conventions. -In the repository root directory, there is a [`.clang-format`](https://github.com/xbmc/xbmc/blob/master/.clang-format) file that implements the rules as specified here. You are encouraged to run [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) on any newly created files. It is currently not recommended to do so on preexisting files because all the formatting changes will clutter your commits and pull request. +In the repository root directory, there is a [`.clang-format`](https://github.com/xbmc/xbmc/blob/master/.clang-format) file that implements the rules as specified here. You are encouraged to run [`clang-format`](https://clang.llvm.org/docs/ClangFormat.html) on any newly created files. It is currently not recommended to do so on preexisting files because all the formatting changes will clutter your commits and pull request. Note that the version of `clang-format` needs to be at least verson 9.0. When you create a pull request, the PR build job will run `clang-format` on your commits and provide patches for any parts that don't satisfy the current `.clang-format` rules. You should apply these patches and amend your pull request accordingly.