Skip to content
Prev Previous commit
Next Next commit
chore: Require astyle 3.4.13 and switch to --project
- Bump required astyle from 3.0.1 to 3.4.13 to enable easy installs via
  pipx/uvx from PyPI.
- Keep formatting stable: 3.4.13 matches our current output, whereas 3.6.9
  changes continuation-line indentation (e.g., after &&).
- Use `--project` (available since 3.2) instead of `--options` to simplify
  config discovery.

No formatting diffs expected with the current `.astylerc`
  • Loading branch information
jcfr committed Aug 25, 2025
commit 421b688910f08d62938e864fe0cbbb97c9f36a79
7 changes: 4 additions & 3 deletions runastyle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ cd $SCRIPT_DIR
# To require a newer astyle version, update ASTYLE_VERSION below.
# ASTYLE_VERSION_STR is then constructed to match the beginning of the
# version string reported by "astyle --version".
ASTYLE_VERSION="3.0.1"
ASTYLE_VERSION="3.4.13"
ASTYLE_VERSION_STR="Artistic Style Version ${ASTYLE_VERSION}"
ASTYLE="astyle"

Expand All @@ -22,5 +22,6 @@ if [[ "$DETECTED_VERSION_STR" != ${ASTYLE_VERSION_STR}* ]]; then
exit 1;
fi

$ASTYLE --options="$SCRIPT_DIR/.astylerc" *.cpp
$ASTYLE --options="$SCRIPT_DIR/.astylerc" *.h
# Run astyle with the project config
$ASTYLE --project *.cpp
$ASTYLE --project *.h
7 changes: 4 additions & 3 deletions runastyle.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ CD /d %SCRIPT_DIR%
REM To require a newer astyle version, update ASTYLE_VERSION below.
REM ASTYLE_VERSION_STR is then constructed to match the beginning of the
REM version string reported by "astyle --version".
SET ASTYLE_VERSION="3.0.1"
SET ASTYLE_VERSION="3.4.13"
SET ASTYLE_VERSION_STR="Artistic Style Version %ASTYLE_VERSION%"
SET ASTYLE="astyle"

Expand All @@ -28,8 +28,9 @@ ECHO %DETECTED_VERSION_STR% | FINDSTR /B /C:%ASTYLE_VERSION_STR% > nul && (
GOTO EXIT_ERROR
)

%ASTYLE% --options="%SCRIPT_DIR%/.astylerc" *.cpp
%ASTYLE% --options="%SCRIPT_DIR%/.astylerc" *.h
REM Run astyle with the project config
%ASTYLE% --project *.cpp
%ASTYLE% --project *.h
GOTO :EOF

:EXIT_ERROR
Expand Down