Skip to content

Commit bb020f5

Browse files
philzCommit Queue Bot
authored andcommitted
Revert "gh actions: run formatters in parallel"
This reverts commit 07cdd551613643a6f4ecfa6169448625705573c7.
1 parent 440fd83 commit bb020f5

File tree

1 file changed

+30
-50
lines changed

1 file changed

+30
-50
lines changed

bin/run-formatters.sh

Lines changed: 30 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -13,62 +13,42 @@ else
1313
echo "Running in fix mode (formatting will be modified)"
1414
fi
1515

16-
# Run both formatters in parallel
17-
echo "Running Go and webui formatters in parallel..."
18-
19-
# Run Go formatting in background
20-
(
21-
echo "Checking Go formatting..."
22-
if [ "$CHECK_MODE" = true ]; then
23-
# In check mode, we want to display the files that need formatting and exit with error if any
24-
FILES_TO_FORMAT=$(gofumpt -l .)
25-
if [ -n "$FILES_TO_FORMAT" ]; then
26-
echo "The following Go files need formatting:"
27-
echo "$FILES_TO_FORMAT"
28-
exit 1
29-
else
30-
echo "Go formatting check passed"
31-
fi
16+
# Go formatting with gofumpt
17+
echo "Checking Go formatting..."
18+
if [ "$CHECK_MODE" = true ]; then
19+
# In check mode, we want to display the files that need formatting and exit with error if any
20+
FILES_TO_FORMAT=$(gofumpt -l .)
21+
if [ -n "$FILES_TO_FORMAT" ]; then
22+
echo "The following Go files need formatting:"
23+
echo "$FILES_TO_FORMAT"
24+
exit 1
3225
else
33-
# In fix mode, we apply the formatting
34-
echo "Fixing Go formatting with gofumpt"
35-
gofumpt -w .
36-
echo "Go formatting complete"
26+
echo "Go formatting check passed"
3727
fi
38-
) &
39-
GO_PID=$!
28+
else
29+
# In fix mode, we apply the formatting
30+
echo "Fixing Go formatting with gofumpt"
31+
gofumpt -w .
32+
echo "Go formatting complete"
33+
fi
4034

41-
# Run webui formatting in background
42-
(
43-
echo "Checking webui formatting..."
44-
if [ -d "./webui" ]; then
45-
cd webui
46-
if [ "$CHECK_MODE" = true ]; then
47-
echo "Checking webui formatting with Prettier"
48-
if ! npx [email protected] --check .; then
49-
echo "Webui files need formatting"
50-
exit 1
51-
fi
52-
else
53-
echo "Fixing webui formatting with Prettier"
54-
npx [email protected] --write .
55-
echo "Webui formatting complete"
35+
# Webui formatting with Prettier
36+
echo "Checking webui formatting..."
37+
if [ -d "./webui" ]; then
38+
cd webui
39+
if [ "$CHECK_MODE" = true ]; then
40+
echo "Checking webui formatting with Prettier"
41+
if ! npx [email protected] --check .; then
42+
echo "Webui files need formatting"
43+
exit 1
5644
fi
5745
else
58-
echo "No webui directory found, skipping Prettier check"
46+
echo "Fixing webui formatting with Prettier"
47+
npx [email protected] --write .
48+
echo "Webui formatting complete"
5949
fi
60-
) &
61-
WEBUI_PID=$!
62-
63-
# Wait for both processes and capture exit codes
64-
wait $GO_PID
65-
GO_EXIT=$?
66-
wait $WEBUI_PID
67-
WEBUI_EXIT=$?
68-
69-
# Exit with error if either formatter failed
70-
if [ $GO_EXIT -ne 0 ] || [ $WEBUI_EXIT -ne 0 ]; then
71-
exit 1
50+
else
51+
echo "No webui directory found, skipping Prettier check"
7252
fi
7353

7454
if [ "$CHECK_MODE" = true ]; then

0 commit comments

Comments
 (0)