@@ -54,7 +54,7 @@ invoke_formatter() {
5454 exit 2
5555 fi
5656
57- if (( ! #source_files )) source_files=(( libobs| libobs-*| UI | plugins| deps| shared)/**/* .(c| cpp| h| hpp| m| mm)(.N))
57+ if (( ! #source_files )) source_files=(( libobs| libobs-*| frontend | plugins| deps| shared| test )/**/* .(c| cpp| h| hpp| m| mm)(.N))
5858
5959 source_files=(${source_files:#*/ (obs-websocket/ deps|decklink/*/ decklink-sdk|mac-syphon/ syphon-framework|libdshowcapture)/* } )
6060
@@ -96,13 +96,13 @@ invoke_formatter() {
9696 if (( ${+commands[gersemi]} )) {
9797 local gersemi_version=($( gersemi --version) )
9898
99- if ! is-at-least 0.12 .0 ${gersemi_version[2]} ; then
100- log_error " gersemi is not version 0.12 .0 or above (found ${gersemi_version[2]} ."
99+ if ! is-at-least 0.21 .0 ${gersemi_version[2]} ; then
100+ log_error " gersemi is not version 0.21 .0 or above (found ${gersemi_version[2]} ."
101101 exit 2
102102 fi
103103 }
104104
105- if (( ! #source_files )) source_files=(CMakeLists.txt (libobs| libobs-* | UI | plugins| deps| shared| cmake| test)/** /(CMakeLists.txt| * .cmake)(.N))
105+ if (( ! #source_files )) source_files=(CMakeLists.txt (libobs| libobs-* | frontend | plugins| deps| shared| cmake| test)/** /(CMakeLists.txt| * .cmake)(.N))
106106
107107 source_files=(${source_files:#*/ (jansson|decklink/*/ decklink-sdk|obs-websocket|obs-browser|libdshowcapture)/* } )
108108 source_files=(${source_files:# (cmake/ Modules/* |*/ legacy.cmake)} )
@@ -116,9 +116,13 @@ invoke_formatter() {
116116 if (( ${# source_files} )) {
117117 while read -r line; do
118118 local -a line_tokens=(${(z)line} )
119- file=${line_tokens[1]//* obs-studio\/ / }
119+ if (( #line_tokens )) {
120+ file=${line_tokens[1]//* ${project_root} \/ / }
120121
121- log_error " ${file} requires formatting changes."
122+ log_error " ${file} requires formatting changes."
123+ } else {
124+ log_error " ${line} "
125+ }
122126
123127 if (( fail_on_error == 2 )) return 2
124128 num_failures=$(( num_failures + 1 ))
@@ -150,7 +154,7 @@ invoke_formatter() {
150154 exit 2
151155 }
152156
153- if (( ! #source_files )) source_files=(( libobs| libobs-*| UI | plugins)/**/* .swift(.N))
157+ if (( ! #source_files )) source_files=(( libobs| libobs-*| frontend | plugins)/**/* .swift(.N))
154158
155159 check_files () {
156160 local -i num_failures=0
@@ -205,6 +209,7 @@ invoke_formatter() {
205209run_format () {
206210 if (( ! ${+SCRIPT_HOME} )) typeset -g SCRIPT_HOME=${ZSH_ARGZERO: A: h}
207211 if (( ! ${+FORMATTER_NAME} )) typeset -g FORMATTER_NAME=${${(s:-: )ZSH_ARGZERO: t: r} [2]}
212+ local project_root=${SCRIPT_HOME: A: h}
208213
209214 typeset -g host_os=${${(L)$(uname -s)} // darwin/ macos}
210215 local -i fail_on_error=0
0 commit comments