Skip to content

Commit a6297eb

Browse files
Remove all formatting tasks from pre-commit
1 parent 5b58d1d commit a6297eb

3 files changed

Lines changed: 0 additions & 135 deletions

File tree

.githooks/pre-commit

Lines changed: 0 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,6 @@ set -euo pipefail
1515
# true: sync root .vscode config files to Template/.vscode when staged.
1616
: "${PRECOMMIT_ENABLE_VSCODE_SYNC:=true}"
1717

18-
# true: run dotnet format on detected changed C# files.
19-
: "${PRECOMMIT_ENABLE_FORMAT:=true}"
20-
21-
# true: remove optional braces around return;, return true;, and return false; blocks.
22-
: "${PRECOMMIT_ENABLE_FORMAT_RETURNS:=true}"
23-
24-
# dotnet format mode: whitespace or full.
25-
# whitespace is faster for commit-time checks while still using dotnet format.
26-
: "${PRECOMMIT_FORMAT_MODE:=full}"
27-
2818
# true: run targeted builds for changed project areas.
2919
: "${PRECOMMIT_ENABLE_BUILD_GODOTUTILS:=true}"
3020
: "${PRECOMMIT_ENABLE_BUILD_VISUALIZE:=true}"
@@ -71,13 +61,6 @@ build_packetgen=false
7161
build_optionsgen=false
7262
build_template=false
7363

74-
declare -a format_godotutils=()
75-
declare -a format_visualize=()
76-
declare -a format_packetgen=()
77-
declare -a format_optionsgen=()
78-
declare -a format_template=()
79-
declare -a format_fallback=()
80-
8164
# Only run full solution validation when staged files can affect compilation.
8265
requires_full_build=false
8366

@@ -109,29 +92,6 @@ for staged_path in "${STAGED_PATHS[@]}"; do
10992
esac
11093
done
11194

112-
for cs_path in "${STAGED_CS[@]}"; do
113-
case "$cs_path" in
114-
Template.GodotUtils/*.cs)
115-
format_godotutils+=("$cs_path")
116-
;;
117-
Template.Visualize/*.cs)
118-
format_visualize+=("$cs_path")
119-
;;
120-
Template.PacketGen/*.cs)
121-
format_packetgen+=("$cs_path")
122-
;;
123-
Template.OptionsGen/*.cs)
124-
format_optionsgen+=("$cs_path")
125-
;;
126-
Template/*.cs)
127-
format_template+=("$cs_path")
128-
;;
129-
*)
130-
format_fallback+=("$cs_path")
131-
;;
132-
esac
133-
done
134-
13595
# Visualize depends on GodotUtils
13696
if $build_visualize; then
13797
build_godotutils=true
@@ -160,34 +120,6 @@ if echo "$STAGED" | grep -Eq "^\.vscode/(extensions|settings|tasks)\.json$"; the
160120
fi
161121
fi
162122

163-
# ------------------------------------------------------------
164-
# Format changed C# files only
165-
# ------------------------------------------------------------
166-
167-
if is_enabled "$PRECOMMIT_ENABLE_FORMAT"; then
168-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template.GodotUtils/GodotUtils.csproj" "$PRECOMMIT_FORMAT_MODE" "${format_godotutils[@]}"
169-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template.Visualize/Visualize.csproj" "$PRECOMMIT_FORMAT_MODE" "${format_visualize[@]}"
170-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template.PacketGen/PacketGen.sln" "$PRECOMMIT_FORMAT_MODE" "${format_packetgen[@]}"
171-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template.OptionsGen/OptionsGen/OptionsGen.csproj" "$PRECOMMIT_FORMAT_MODE" "${format_optionsgen[@]}"
172-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template/Template.csproj" "$PRECOMMIT_FORMAT_MODE" "${format_template[@]}"
173-
174-
if [ "${#format_fallback[@]}" -gt 0 ]; then
175-
echo "[pre-commit] Formatting fallback (Template.sln) for unmapped C# paths..."
176-
"$SCRIPTS_DIR/format-cs" "$REPO_ROOT/Template.sln" "$PRECOMMIT_FORMAT_MODE" "${format_fallback[@]}"
177-
fi
178-
else
179-
echo "[pre-commit] Formatting disabled by PRECOMMIT_ENABLE_FORMAT=false"
180-
fi
181-
182-
# ------------------------------------------------------------
183-
# Normalize return brace style
184-
# ------------------------------------------------------------
185-
if is_enabled "$PRECOMMIT_ENABLE_FORMAT_RETURNS"; then
186-
"$SCRIPTS_DIR/format-returns" "${STAGED_CS[@]}"
187-
else
188-
echo "[pre-commit] Return formatting disabled by PRECOMMIT_ENABLE_FORMAT_RETURNS=false"
189-
fi
190-
191123
# ------------------------------------------------------------
192124
# Build GodotUtils
193125
# ------------------------------------------------------------

.githooks/scripts/format-cs

Lines changed: 0 additions & 39 deletions
This file was deleted.

.githooks/scripts/format-returns

Lines changed: 0 additions & 28 deletions
This file was deleted.

0 commit comments

Comments
 (0)