@@ -8,11 +8,6 @@ set(N 10)
88include (FindPython3)
99find_package (Python3 COMPONENTS Interpreter)
1010
11- find_program (ASTYLE_TOOL NAMES astyle)
12- execute_process (COMMAND ${ASTYLE_TOOL} --version OUTPUT_VARIABLE ASTYLE_TOOL_VERSION ERROR_VARIABLE ASTYLE_TOOL_VERSION)
13- string (REGEX MATCH "[0-9]+(\\ .[0-9]+)+" ASTYLE_TOOL_VERSION "${ASTYLE_TOOL_VERSION} " )
14- message (STATUS "🔖 Artistic Style ${ASTYLE_TOOL_VERSION} (${ASTYLE_TOOL} )" )
15-
1611find_program (CLANG_TOOL NAMES clang++-HEAD clang++ clang++-20 clang++-19 clang++-18 clang++-17 clang++-16 clang++-15 clang++-14 clang++-13 clang++-12 clang++-11 clang++)
1712execute_process (COMMAND ${CLANG_TOOL} --version OUTPUT_VARIABLE CLANG_TOOL_VERSION ERROR_VARIABLE CLANG_TOOL_VERSION)
1813string (REGEX MATCH "[0-9]+(\\ .[0-9]+)+" CLANG_TOOL_VERSION "${CLANG_TOOL_VERSION} " )
@@ -632,8 +627,6 @@ add_custom_target(ci_test_clang_sanitizer
632627# Check if header is amalgamated and sources are properly indented.
633628###############################################################################
634629
635- set (ASTYLE_FLAGS --style=allman --indent=spaces=4 --indent-modifiers --indent-switches --indent-preproc-block --indent-preproc-define --indent-col1-comments --pad-oper --pad-header --align-pointer=type --align-reference=type --add-brackets --convert-tabs --close-templates --lineend=linux --preserve-date --formatted)
636-
637630file (GLOB_RECURSE INDENT_FILES
638631 ${PROJECT_SOURCE_DIR} /include /nlohmann/*.hpp
639632 ${PROJECT_SOURCE_DIR} /tests/src/*.cpp
@@ -649,14 +642,18 @@ add_custom_target(ci_test_amalgamation
649642 COMMAND cp ${include_dir} /json.hpp ${include_dir} /json.hpp~
650643 COMMAND cp ${include_dir} /json_fwd.hpp ${include_dir} /json_fwd.hpp~
651644
645+ COMMAND ${Python3_EXECUTABLE} -mvenv venv_astyle
646+ COMMAND venv_astyle/bin/pip3 --quiet install -r ${CMAKE_SOURCE_DIR} /tools/astyle/requirements.txt
647+ COMMAND venv_astyle/bin/astyle --version
648+
652649 COMMAND ${Python3_EXECUTABLE} ${tool_dir} /amalgamate.py -c ${tool_dir} /config_json.json -s .
653650 COMMAND ${Python3_EXECUTABLE} ${tool_dir} /amalgamate.py -c ${tool_dir} /config_json_fwd.json -s .
654- COMMAND ${ASTYLE_TOOL} ${ASTYLE_FLAGS} -- suffix =none --quiet ${include_dir} /json.hpp ${include_dir} /json_fwd.hpp
651+ COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc --suffix =none ${include_dir} /json.hpp ${include_dir} /json_fwd.hpp
655652
656653 COMMAND diff ${include_dir} /json.hpp~ ${include_dir} /json.hpp
657654 COMMAND diff ${include_dir} /json_fwd.hpp~ ${include_dir} /json_fwd.hpp
658655
659- COMMAND ${ASTYLE_TOOL} ${ASTYLE_FLAGS} ${INDENT_FILES}
656+ COMMAND venv_astyle/bin/astyle --project=tools/astyle/.astylerc -- suffix =orig ${INDENT_FILES}
660657 COMMAND for FILE in `find . -name '*.orig'`\; do false \; done
661658
662659 WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
0 commit comments