From cf05d014d5269f557b4f05493657a30b061ef0ea Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Thu, 31 Jul 2025 00:26:23 -0400 Subject: [PATCH 1/2] refactor (*): add newlines --- CMakeLists.txt | 1 + Dockerfile | 1 + Makefile | 1 + README.md | 1 + scripts/templateapp.sh | 1 + src/CMakeLists.txt | 1 + src/templateapp.m.cpp | 1 + src/templateapp_util/CMakeLists.txt | 1 + src/templateapp_util/templateapp_util.cpp | 1 + src/templateapp_util/templateapp_util.h | 1 + tests/CMakeLists.txt | 1 + tests/integration/CMakeLists.txt | 1 + tests/integration/templateapp_util.t.cpp | 1 + tests/unit/CMakeLists.txt | 1 + tests/unit/templateapp_util.t.cpp | 1 + 15 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fa54d5..c02f116 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,3 +43,4 @@ set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${CPACK_SYSTEM_NAME}) set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) include(CPack) + diff --git a/Dockerfile b/Dockerfile index 74b244d..392df68 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,3 +25,4 @@ COPY --from=build /usr/local/src/templateapp/build/templateapp-Linux.deb /usr/lo WORKDIR /usr/local/bin RUN dpkg -i templateapp-Linux.deb ENTRYPOINT [ "/usr/bin/templateapp.sh" ] + diff --git a/Makefile b/Makefile index a91e4a7..39dfc12 100644 --- a/Makefile +++ b/Makefile @@ -18,3 +18,4 @@ package: test: cd ${BUILD_DIR} && ctest --verbose + diff --git a/README.md b/README.md index 303bfc2..6d758b0 100644 --- a/README.md +++ b/README.md @@ -24,3 +24,4 @@ docker run -it --rm templateapp docker build --target=run -t templateapp . docker run -it --rm templateapp ``` + diff --git a/scripts/templateapp.sh b/scripts/templateapp.sh index 6c0dfe5..b77fa0f 100644 --- a/scripts/templateapp.sh +++ b/scripts/templateapp.sh @@ -1,3 +1,4 @@ #!/bin/sh /usr/bin/templateapp + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0deb060..d4be015 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -18,3 +18,4 @@ target_include_directories(${EXECUTABLE_NAME} PRIVATE . ) + diff --git a/src/templateapp.m.cpp b/src/templateapp.m.cpp index 56eae4c..0654a7f 100644 --- a/src/templateapp.m.cpp +++ b/src/templateapp.m.cpp @@ -13,3 +13,4 @@ int main() std::cout << meaningOfLifeTheUniverseAndEverything(question) << std::endl; return 0; } + diff --git a/src/templateapp_util/CMakeLists.txt b/src/templateapp_util/CMakeLists.txt index fdfd44c..b80733d 100644 --- a/src/templateapp_util/CMakeLists.txt +++ b/src/templateapp_util/CMakeLists.txt @@ -24,3 +24,4 @@ target_include_directories(${LIBRARY_NAME} PRIVATE . ) + diff --git a/src/templateapp_util/templateapp_util.cpp b/src/templateapp_util/templateapp_util.cpp index 8e6e1d9..c079dce 100644 --- a/src/templateapp_util/templateapp_util.cpp +++ b/src/templateapp_util/templateapp_util.cpp @@ -7,3 +7,4 @@ int meaningOfLifeTheUniverseAndEverything(const std::string& question) { } } // close namespace templateapp + diff --git a/src/templateapp_util/templateapp_util.h b/src/templateapp_util/templateapp_util.h index 7d0725f..62410be 100644 --- a/src/templateapp_util/templateapp_util.h +++ b/src/templateapp_util/templateapp_util.h @@ -14,3 +14,4 @@ namespace templateapp { } // close namespace templateapp #endif /* TEMPLATEAPP_UTIL_H */ + diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ebcd6b5..98ecc10 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -2,3 +2,4 @@ add_subdirectory(integration) add_subdirectory(unit) add_test(NAME unittest COMMAND templateapp.u.t) + diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index 686f199..848c7a8 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -12,3 +12,4 @@ target_sources(templateapp.i.t PRIVATE templateapp_util.t.cpp ) + diff --git a/tests/integration/templateapp_util.t.cpp b/tests/integration/templateapp_util.t.cpp index cb75f3d..48c7cd0 100644 --- a/tests/integration/templateapp_util.t.cpp +++ b/tests/integration/templateapp_util.t.cpp @@ -9,3 +9,4 @@ TEST_CASE( "The answer to life, the universe, and everything", "[templateapp_uti } } // close namespace templateapp + diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 9dfe373..5ba8b83 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -12,3 +12,4 @@ target_sources(templateapp.u.t PRIVATE templateapp_util.t.cpp ) + diff --git a/tests/unit/templateapp_util.t.cpp b/tests/unit/templateapp_util.t.cpp index cb75f3d..48c7cd0 100644 --- a/tests/unit/templateapp_util.t.cpp +++ b/tests/unit/templateapp_util.t.cpp @@ -9,3 +9,4 @@ TEST_CASE( "The answer to life, the universe, and everything", "[templateapp_uti } } // close namespace templateapp + From ef1b2802fe22a9b2d8958a7bb3cf7a6c57b6e737 Mon Sep 17 00:00:00 2001 From: Hunter LaTourette Date: Thu, 31 Jul 2025 01:03:08 -0400 Subject: [PATCH 2/2] refactor (*): simplify naming --- src/CMakeLists.txt | 4 ++-- src/templateapp.m.cpp | 2 +- src/{templateapp_util => util}/CMakeLists.txt | 6 +++--- .../templateapp_util.cpp => util/util.cpp} | 2 +- src/{templateapp_util/templateapp_util.h => util/util.h} | 0 tests/integration/CMakeLists.txt | 4 ++-- tests/integration/{templateapp_util.t.cpp => util.t.cpp} | 2 +- tests/unit/CMakeLists.txt | 4 ++-- tests/unit/{templateapp_util.t.cpp => util.t.cpp} | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) rename src/{templateapp_util => util}/CMakeLists.txt (76%) rename src/{templateapp_util/templateapp_util.cpp => util/util.cpp} (83%) rename src/{templateapp_util/templateapp_util.h => util/util.h} (100%) rename tests/integration/{templateapp_util.t.cpp => util.t.cpp} (90%) rename tests/unit/{templateapp_util.t.cpp => util.t.cpp} (90%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d4be015..97222eb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,12 +1,12 @@ set(EXECUTABLE_NAME templateapp) -add_subdirectory(templateapp_util) +add_subdirectory(util) add_executable(${EXECUTABLE_NAME}) target_link_libraries(${EXECUTABLE_NAME} PRIVATE - templateapplib + util ) target_sources(${EXECUTABLE_NAME} diff --git a/src/templateapp.m.cpp b/src/templateapp.m.cpp index 0654a7f..b2268ed 100644 --- a/src/templateapp.m.cpp +++ b/src/templateapp.m.cpp @@ -1,7 +1,7 @@ #include #include -#include +#include "util.h" using namespace templateapp; diff --git a/src/templateapp_util/CMakeLists.txt b/src/util/CMakeLists.txt similarity index 76% rename from src/templateapp_util/CMakeLists.txt rename to src/util/CMakeLists.txt index b80733d..eeaf142 100644 --- a/src/templateapp_util/CMakeLists.txt +++ b/src/util/CMakeLists.txt @@ -1,4 +1,4 @@ -set(LIBRARY_NAME templateapplib) +set(LIBRARY_NAME util) add_library(${LIBRARY_NAME} STATIC) @@ -10,12 +10,12 @@ target_link_libraries(${LIBRARY_NAME} target_sources(${LIBRARY_NAME} PRIVATE - templateapp_util.cpp + util.cpp INTERFACE PUBLIC FILE_SET HEADERS FILES - templateapp_util.h + util.h ) target_include_directories(${LIBRARY_NAME} diff --git a/src/templateapp_util/templateapp_util.cpp b/src/util/util.cpp similarity index 83% rename from src/templateapp_util/templateapp_util.cpp rename to src/util/util.cpp index c079dce..76910fa 100644 --- a/src/templateapp_util/templateapp_util.cpp +++ b/src/util/util.cpp @@ -1,4 +1,4 @@ -#include +#include "util.h" namespace templateapp { diff --git a/src/templateapp_util/templateapp_util.h b/src/util/util.h similarity index 100% rename from src/templateapp_util/templateapp_util.h rename to src/util/util.h diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index 848c7a8..43e5cc8 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -5,11 +5,11 @@ add_executable(templateapp.i.t) target_link_libraries(templateapp.i.t PRIVATE Catch2::Catch2WithMain - templateapplib + util ) target_sources(templateapp.i.t PRIVATE - templateapp_util.t.cpp + util.t.cpp ) diff --git a/tests/integration/templateapp_util.t.cpp b/tests/integration/util.t.cpp similarity index 90% rename from tests/integration/templateapp_util.t.cpp rename to tests/integration/util.t.cpp index 48c7cd0..ccd982d 100644 --- a/tests/integration/templateapp_util.t.cpp +++ b/tests/integration/util.t.cpp @@ -1,6 +1,6 @@ #include -#include +#include "util.h" namespace templateapp { diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 5ba8b83..9bea74f 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -5,11 +5,11 @@ add_executable(templateapp.u.t) target_link_libraries(templateapp.u.t PRIVATE Catch2::Catch2WithMain - templateapplib + util ) target_sources(templateapp.u.t PRIVATE - templateapp_util.t.cpp + util.t.cpp ) diff --git a/tests/unit/templateapp_util.t.cpp b/tests/unit/util.t.cpp similarity index 90% rename from tests/unit/templateapp_util.t.cpp rename to tests/unit/util.t.cpp index 48c7cd0..ccd982d 100644 --- a/tests/unit/templateapp_util.t.cpp +++ b/tests/unit/util.t.cpp @@ -1,6 +1,6 @@ #include -#include +#include "util.h" namespace templateapp {