CI: Update clang-format to 22.1.3

This commit is contained in:
PatTheMav
2026-06-12 17:22:50 -04:00
committed by Ryan Foster
parent ef97d2eabd
commit fe522d431e
2 changed files with 11 additions and 12 deletions
+4 -4
View File
@@ -35,7 +35,7 @@ runs:
echo ::group::Install Dependencies
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo "/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@19/bin" >> $GITHUB_PATH
echo "/home/linuxbrew/.linuxbrew/opt/clang-format@22/bin" >> $GITHUB_PATH
brew install --quiet zsh
echo ::endgroup::
@@ -50,11 +50,11 @@ runs:
: Run clang-format 🐉
if (( ${+RUNNER_DEBUG} )) setopt XTRACE
print ::group::Install clang-format-19
brew install --quiet obsproject/tools/clang-format@19
print ::group::Install clang-format-22
brew install --quiet obsproject/tools/clang-format@22
print ::endgroup::
print ::group::Run clang-format-19
print ::group::Run clang-format-22
local -a changes=(${(s:,:)CHANGED_FILES//[\[\]\'\"]/})
./build-aux/run-clang-format --fail-${{ inputs.failCondition }} --check ${changes}
print ::endgroup::
+7 -8
View File
@@ -33,25 +33,24 @@ invoke_formatter() {
case ${formatter} {
clang)
if (( ${+commands[clang-format-19]} )) {
local formatter=clang-format-19
if (( ${+commands[clang-format-22]} )) {
local formatter=clang-format-22
} elif (( ${+commands[clang-format]} )) {
local formatter=clang-format
} else {
log_error "No viable clang-format version found (required 19.1.1)"
log_error "No viable clang-format version found (required 22.1.3)"
exit 2
}
local -a formatter_version=($(${formatter} --version))
if ! is-at-least 19.1.1 ${formatter_version[-1]}; then
log_error "clang-format is not version 19.1.1 or above (found ${formatter_version[-1]}."
if ! is-at-least 22.1.3 ${formatter_version[-1]}; then
log_error "clang-format is not version 22.1.3 or above (found ${formatter_version[-1]}."
exit 2
fi
if ! is-at-least ${formatter_version[-1]} 19.1.1; then
log_error "clang-format is more recent than version 19.1.1 (found ${formatter_version[-1]})."
exit 2
if ! is-at-least ${formatter_version[-1]} 22.1.3; then
log_warning "clang-format is more recent than version 22.1.3 (found ${formatter_version[-1]})."
fi
if (( ! #source_files )) source_files=((libobs|libobs-*|frontend|plugins|deps|shared|test)/**/*.(c|cpp|h|hpp|m|mm)(.N))