add scripts for manual code formatting.

This commit is contained in:
HedgehogInTheCPP 2026-08-19 17:01:19 +03:00
parent 4a71c111f2
commit f20dc6dffb
2 changed files with 21 additions and 0 deletions

10
format_code.cmd Normal file
View File

@ -0,0 +1,10 @@
@echo off
echo Formatting all C/C++ files recursively...
for /r %%i in (*.cpp *.h *.hpp *.cc *.c) do (
echo Formatting: %%i
clang-format -i -style=file "%%i"
)
echo Formatting complete!
pause

11
format_code.sh Normal file
View File

@ -0,0 +1,11 @@
#!/bin/bash
echo "Formatting all C/C++ files recursively..."
# Find and format files using an optimized execution loop
find . -type f \( -name "*.cpp" -o -name "*.h" -o -name "*.hpp" -o -name "*.cc" -o -name "*.c" \) -exec echo "Formatting: {}" \; -exec clang-format -style=file -i {} \;
echo "Formatting complete!"
# Pause analog: waits for a single keypress (-n 1) and hides the input (-s)
echo "Press any key to continue . . ."
read -n 1 -s -r