Skip to content

Commit 5c791a4

Browse files
committed
chore: Support astyle IDE integration and de-duplicate settings
This change introduces a `.astylerc` configuration file to centralize and simplify the astyle settings for both the runastyle script and IDE integration.
1 parent aa77332 commit 5c791a4

3 files changed

Lines changed: 19 additions & 10 deletions

File tree

.astylerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# style
2+
--style=kr
3+
--indent=spaces=4
4+
--indent-namespaces
5+
--lineend=linux
6+
--min-conditional-indent=0
7+
8+
# options
9+
--pad-header
10+
--unpad-paren
11+
--suffix=none
12+
--convert-tabs
13+
--attach-inlines
14+
--attach-classes
15+
--attach-namespaces

runastyle

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,5 @@ if [[ "$DETECTED_VERSION" != ${ASTYLE_VERSION}* ]]; then
2020
exit 1;
2121
fi
2222

23-
style="--style=kr --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0"
24-
options="--options=none --pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines --attach-classes --attach-namespaces"
25-
26-
$ASTYLE $style $options *.cpp
27-
$ASTYLE $style $options *.h
23+
$ASTYLE --options="$SCRIPT_DIR/.astylerc" *.cpp
24+
$ASTYLE --options="$SCRIPT_DIR/.astylerc" *.h

runastyle.bat

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,5 @@ CD /d %SCRIPT_DIR%
2525
GOTO EXIT_ERROR
2626
)
2727

28-
@SET STYLE=--style=kr --indent=spaces=4 --indent-namespaces --lineend=linux --min-conditional-indent=0
29-
@SET OPTIONS=--pad-header --unpad-paren --suffix=none --convert-tabs --attach-inlines --attach-classes --attach-namespaces
30-
31-
%ASTYLE% %STYLE% %OPTIONS% *.cpp
32-
%ASTYLE% %STYLE% %OPTIONS% *.h
28+
%ASTYLE% --options="%SCRIPT_DIR%/.astylerc" *.cpp
29+
%ASTYLE% --options="%SCRIPT_DIR%/.astylerc" *.h

0 commit comments

Comments
 (0)