diff --git a/tests/.config/.clang-format b/tests/.config/.clang-format index ed27099e2..81fa923de 100644 --- a/tests/.config/.clang-format +++ b/tests/.config/.clang-format @@ -1,6 +1,4 @@ ---- Language: Cpp -BasedOnStyle: Google AccessModifierOffset: -2 AlignAfterOpenBracket: DontAlign AlignConsecutiveAssignments: false @@ -30,7 +28,6 @@ BreakBeforeTernaryOperators: true BreakConstructorInitializers: AfterColon BreakInheritanceList: AfterColon BreakStringLiterals: false -ColumnLimit: 59 CompactNamespaces: true ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 @@ -91,4 +88,3 @@ SpacesInContainerLiterals: false SpacesInParentheses: false SpacesInSquareBrackets: false Standard: c++20 -... diff --git a/tests/.config/dev.clang-format b/tests/.config/dev.clang-format new file mode 100644 index 000000000..eef5326b3 --- /dev/null +++ b/tests/.config/dev.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: InheritParentConfig +ColumnLimit: 59 +... diff --git a/tests/.config/main.clang-format b/tests/.config/main.clang-format new file mode 100644 index 000000000..58211c6f7 --- /dev/null +++ b/tests/.config/main.clang-format @@ -0,0 +1,5 @@ +--- +Language: Cpp +BasedOnStyle: InheritParentConfig +ColumnLimit: 0 +... diff --git a/tests/Makefile b/tests/Makefile index 41fcb579a..a83429382 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -7,8 +7,6 @@ help: @echo " |" @echo "make grep_clangformat_cppcheck | various greps to catch certain things, clang-format, cppcheck" @echo " |" - @echo "make do_format | format with clang-format" - @echo " |" @echo "make clangtidy | runs clang-tidy (mainly to verify snake_case)" @echo " |" @echo "make build_pdf | build build_pdf.pdf from .tex file" @@ -32,9 +30,6 @@ compile_clang: grep_clangformat_cppcheck: ./scripts/grep_clangformat_cppcheck.sh -do_format: - ./scripts/do_format.sh - clangtidy: ./scripts/clangtidy.sh diff --git a/tests/scripts/do_format.sh b/tests/scripts/do_format.sh deleted file mode 100755 index 7a41729a2..000000000 --- a/tests/scripts/do_format.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -# ** glob now searches any number of levels -shopt -s globstar - -clang-format-19 -i --style=file:.config/.clang-format ../**/*.hpp ../**/*.cpp diff --git a/tests/scripts/grep_clangformat_cppcheck.sh b/tests/scripts/grep_clangformat_cppcheck.sh index 9c39c6d74..8c2b4851f 100755 --- a/tests/scripts/grep_clangformat_cppcheck.sh +++ b/tests/scripts/grep_clangformat_cppcheck.sh @@ -43,7 +43,7 @@ find ../library/ library_checker_aizu_tests/ -name "*[A-Z]*" -or -name "*-*" | grep --invert-match "README" && exit 1 -clang-format-19 --dry-run --Werror --style=file:.config/.clang-format library_checker_aizu_tests/**/*.hpp library_checker_aizu_tests/**/*.test.cpp ../library/**/*.hpp ../library/**/*.cpp || exit 1 +clang-format-19 --dry-run --Werror --style=file:.config/dev.clang-format library_checker_aizu_tests/**/*.hpp library_checker_aizu_tests/**/*.test.cpp ../library/**/*.hpp ../library/**/*.cpp || exit 1 git submodule init git submodule update diff --git a/tests/scripts/update_main.sh b/tests/scripts/update_main.sh index fdaae0ba8..a43f1637a 100755 --- a/tests/scripts/update_main.sh +++ b/tests/scripts/update_main.sh @@ -25,5 +25,6 @@ done # the cpp preprocessor sometimes leaves blank empty lines sed --in-place '/^[[:space:]]*$/d' ../**/*.hpp + # cpp command messes up formatting -make do_format +clang-format-19 -i --style=file:.config/main.clang-format ../**/*.hpp ../**/*.cpp