From 99de56e85fbd670f86d6a0e62264a6a8fcf647f9 Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 10:47:36 +0000 Subject: [PATCH 01/11] - --- .github/workflows/ci.yml | 6 ++++ .github/workflows/docker.yaml | 7 +++- .vscode/vsu_timetable.code-workspace | 28 --------------- CMakeLists.txt | 42 ++++++---------------- Makefile | 31 +++++++++++++--- service/main.cpp | 54 ++++++++++++++-------------- utests/hello_test.cpp | 17 +++++---- 7 files changed, 87 insertions(+), 98 deletions(-) delete mode 100644 .vscode/vsu_timetable.code-workspace diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da2ab60f..63d7d6c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,12 @@ jobs: with: submodules: true + - name: Format sources and gen list of them + run: | + make gen + make format-all + - name: Check git status + run: make check-git-status - name: Reuse ccache directory uses: actions/cache@v2 with: diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index f13003d4..ce554cb1 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -15,7 +15,12 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - + - name: Format sources and gen list of them + run: | + make gen + make format-all + - name: Check git status + run: make check-git-status - name: Reuse ccache directory uses: actions/cache@v2 with: diff --git a/.vscode/vsu_timetable.code-workspace b/.vscode/vsu_timetable.code-workspace deleted file mode 100644 index fe5d49e3..00000000 --- a/.vscode/vsu_timetable.code-workspace +++ /dev/null @@ -1,28 +0,0 @@ -{ - "folders": [ - { - "path": "../", - "name" : "vsu_timetable" - }, - ], - "extensions":{ - "recommendations":[ - "llvm-vs-code-extensions.vscode-clangd", - "Redocly.openapi-vs-code", - "ms-vscode.makefile-tools", - "vadimcn.vscode-lldb", - "ms-vscode.cmake-tools", - "notskm.clang-tidy", - "ms-vscode.cpptools" - ] - }, - "settings": { - "files.exclude": { - "third_party": true, - "build*": true, - ".*" : true, - "dependencies" : true - }, - "clang-tidy.buildPath": "../build_debug" - } -} diff --git a/CMakeLists.txt b/CMakeLists.txt index 9c3f7f1e..913cefa2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,50 +9,28 @@ include(GNUInstallDirs) add_subdirectory(third_party/userver) +#make gen source lists are generated in the .gen folder +file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/benchs.txt benchs_src) +file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/objs.txt objs_src) +file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/service.txt service_src) +file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/unittest.txt unittest_src) # Common sources add_library(${PROJECT_NAME}_objs OBJECT - src/views/hello/view.hpp - src/views/hello/view.cpp - src/components/controllers/user_controller.cpp - src/components/controllers/user_controller.hpp - src/components/controllers/user_controller_fwd.hpp - src/components/controllers/user_controller_fwd.cpp - src/components/controllers/token_controller_fwd.cpp - src/components/controllers/user_controller_fwd.cpp - src/components/controllers/token_controller.hpp - src/components/controllers/token_controller.cpp - src/models/auth_token/type.hpp - src/models/auth_token/serialize.hpp - src/http/handler_parsed.hpp - src/models/user/type.hpp - src/models/user_type/parse.cpp - src/models/user_type/parse.hpp - src/models/user_type/postgre.hpp - src/models/user_type/type.hpp - src/utils/component_list_fwd.hpp - src/utils/json_type.cpp - src/utils/json_type.hpp - src/views/login/Request.cpp - src/views/login/Request.hpp - src/views/login/view.cpp - src/views/login/view.hpp - src/views/register/Request.cpp - src/views/register/Request.hpp - src/views/register/view.cpp - src/views/register/view.hpp + ${objs_src} ) target_link_libraries(${PROJECT_NAME}_objs PUBLIC userver-core userver-postgresql) # The Service -add_executable(${PROJECT_NAME} service/main.cpp) +add_executable(${PROJECT_NAME} ${service_src}) target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_objs) + # Unit Tests add_executable(${PROJECT_NAME}_unittest - utests/hello_test.cpp + ${unittest_src} ) target_link_libraries(${PROJECT_NAME}_unittest PRIVATE ${PROJECT_NAME}_objs userver-utest) add_google_tests(${PROJECT_NAME}_unittest) @@ -60,7 +38,7 @@ add_google_tests(${PROJECT_NAME}_unittest) # Benchmarks add_executable(${PROJECT_NAME}_benchmark - benchs/hello_benchmark.cpp + ${benchs_src} ) target_link_libraries(${PROJECT_NAME}_benchmark PRIVATE ${PROJECT_NAME}_objs userver-ubench) add_google_benchmark_tests(${PROJECT_NAME}_benchmark) diff --git a/Makefile b/Makefile index e5591a57..e763e051 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build_release/Makefile: # Run cmake .PHONY: cmake-debug cmake-release -cmake-debug cmake-release: cmake-%: build_%/Makefile +cmake-debug cmake-release: cmake-%: build_%/Makefile: # Build using cmake .PHONY: build-debug build-release @@ -68,12 +68,35 @@ install-debug install-release: install-%: build-% .PHONY: install install: install-release -# Format the sources -.PHONY: format -format: +.PHONY: format-cpp +format-cpp: + @find benchs -name '*pp' -type f | xargs $(CLANG_FORMAT) -i + @find service -name '*pp' -type f | xargs $(CLANG_FORMAT) -i @find src -name '*pp' -type f | xargs $(CLANG_FORMAT) -i + @find utests -name '*pp' -type f | xargs $(CLANG_FORMAT) -i + +# Format the sources +.PHONY: format-all +format: format-cpp @find tests -name '*.py' -type f | xargs autopep8 -i +.PHONY: check-git-status +check-git-status: + @if [ -n "`git status -s`" ]; then \ + echo "There are uncommitted files:" >&2; \ + git status -s >&2 ; \ + exit 1; \ + fi + +.PHONY: gen +gen: + @rm -rf .gen + @mkdir -p .gen + @find benchs -name '*pp' > .gen/benchs.txt + @find src -name '*pp' > .gen/objs.txt + @find service -name '*pp' > .gen/service.txt + @find utests -name '*pp' > .gen/unittest.txt + # Internal hidden targets that are used only in docker environment --in-docker-start-debug --in-docker-start-release: --in-docker-start-%: install-% @sed -i 's/config_vars.yaml/config_vars.docker.yaml/g' /home/user/.local/etc/timetable_vsu_backend/static_config.yaml diff --git a/service/main.cpp b/service/main.cpp index 4e0d8639..acde29c0 100644 --- a/service/main.cpp +++ b/service/main.cpp @@ -1,58 +1,57 @@ -#include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include "../src/components/controllers/token_controller_fwd.hpp" +#include "../src/components/controllers/user_controller_fwd.hpp" #include "../src/views/hello/view.hpp" +#include "../src/views/login/view.hpp" +#include "../src/views/register/view.hpp" #include "userver/formats/json/value.hpp" #include "userver/logging/log.hpp" #include "userver/storages/postgres/component.hpp" -#include "../src/views/login/view.hpp" -#include "../src/views/register/view.hpp" -#include "../src/components/controllers/token_controller_fwd.hpp" -#include "../src/components/controllers/user_controller_fwd.hpp" -#include -#include -#include -#include namespace fs = std::filesystem; -void LogAllFiles(fs::path path){ +void LogAllFiles(fs::path path) { std::stringstream buffer; LOG_ERROR() << path; - for (const auto & entry : fs::directory_iterator(path)) - buffer << entry.path() << ' '; + for (const auto& entry : fs::directory_iterator(path)) + buffer << entry.path() << ' '; LOG_ERROR() << buffer.str(); } -void LogCommands(int argc, char** argv){ +void LogCommands(int argc, char** argv) { std::stringstream buffer; - if (argc == 0){ + if (argc == 0) { LOG_ERROR() << "No commands"; } - for (int i = 0; i < argc; i++){ + for (int i = 0; i < argc; i++) { buffer << argv[i] << ' '; } LOG_ERROR() << fmt::format("Commands is {}", buffer.str()); } -void LogFile(std::string_view path){ +void LogFile(std::string_view path) { std::string path_str(path); std::ifstream file(path_str); std::string temp; - if (!file.is_open()){ + if (!file.is_open()) { std::stringstream buffer; buffer << strerror(errno); LOG_ERROR() << fmt::format("{} ifstream fail: {} ", path, buffer.str()); - } - else if (file.eof()){ + } else if (file.eof()) { LOG_ERROR() << fmt::format("{} is empty", path); } - while (std::getline(file, temp)){ + while (std::getline(file, temp)) { LOG_ERROR() << temp; } file.close(); @@ -68,13 +67,14 @@ int main(int argc, char* argv[]) { // LogFile("config_vars.docker.yaml"); using namespace timetable_vsu_backend::components; using namespace timetable_vsu_backend::views; - auto component_list = userver::components::MinimalServerComponentList() - .Append() - .Append() - .Append() - .Append() - .Append("postgres-db-1") - .Append(); + auto component_list = + userver::components::MinimalServerComponentList() + .Append() + .Append() + .Append() + .Append() + .Append("postgres-db-1") + .Append(); service_template::AppendHello(component_list); timetable_vsu_backend::views::login::Append(component_list); timetable_vsu_backend::views::register_::Append(component_list); diff --git a/utests/hello_test.cpp b/utests/hello_test.cpp index 415e8eb7..c3cf58be 100644 --- a/utests/hello_test.cpp +++ b/utests/hello_test.cpp @@ -1,10 +1,15 @@ -#include "../src/views/hello/view.hpp" -#include #include - +#include +#include "../src/views/hello/view.hpp" UTEST(SayHelloTo, Basic) { - EXPECT_EQ(service_template::SayHelloTo("Developer", service_template::UserType::kKnown), "Hi again, Developer!\n"); - EXPECT_EQ(service_template::SayHelloTo("", service_template::UserType::kFirstTime), "Hello, unknown user!\n"); - EXPECT_EQ(service_template::SayHelloTo("Developer", service_template::UserType::kFirstTime), "Hello, Developer!\n"); + EXPECT_EQ(service_template::SayHelloTo("Developer", + service_template::UserType::kKnown), + "Hi again, Developer!\n"); + EXPECT_EQ( + service_template::SayHelloTo("", service_template::UserType::kFirstTime), + "Hello, unknown user!\n"); + EXPECT_EQ(service_template::SayHelloTo( + "Developer", service_template::UserType::kFirstTime), + "Hello, Developer!\n"); } From 30520239d9d3f699f89f4d685b7c871f49c0a7bb Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 10:54:49 +0000 Subject: [PATCH 02/11] - --- vsu_timetable.code-workspace | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 vsu_timetable.code-workspace diff --git a/vsu_timetable.code-workspace b/vsu_timetable.code-workspace new file mode 100644 index 00000000..f061822e --- /dev/null +++ b/vsu_timetable.code-workspace @@ -0,0 +1,28 @@ +{ + "folders": [ + { + "path": ".", + "name" : "vsu_timetable" + }, + ], + "extensions":{ + "recommendations":[ + "llvm-vs-code-extensions.vscode-clangd", + "Redocly.openapi-vs-code", + "ms-vscode.makefile-tools", + "vadimcn.vscode-lldb", + "ms-vscode.cmake-tools", + "notskm.clang-tidy", + "ms-vscode.cpptools" + ] + }, + "settings": { + "files.exclude": { + // "third_party": true, + // "build*": true, + // ".*" : true, + // "dependencies" : true + }, + "clang-tidy.buildPath": "../build_debug" + } +} From bd6457b3e2941aac666714f5959b57fc5f12bef0 Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 10:57:12 +0000 Subject: [PATCH 03/11] - --- Makefile | 4 ++-- vsu_timetable.code-workspace | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e763e051..2403ceec 100644 --- a/Makefile +++ b/Makefile @@ -82,11 +82,11 @@ format: format-cpp .PHONY: check-git-status check-git-status: - @if [ -n "`git status -s`" ]; then \ + @if [ -n "`git status -s`" ]; then \ echo "There are uncommitted files:" >&2; \ git status -s >&2 ; \ exit 1; \ - fi + fi .PHONY: gen gen: diff --git a/vsu_timetable.code-workspace b/vsu_timetable.code-workspace index f061822e..a29499af 100644 --- a/vsu_timetable.code-workspace +++ b/vsu_timetable.code-workspace @@ -18,10 +18,10 @@ }, "settings": { "files.exclude": { - // "third_party": true, - // "build*": true, - // ".*" : true, - // "dependencies" : true + "third_party": true, + "build*": true, + ".*" : true, + "dependencies" : true }, "clang-tidy.buildPath": "../build_debug" } From 507d14b26b8a11ae44f0d4071358012212ef741f Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 10:59:40 +0000 Subject: [PATCH 04/11] - --- .gen/benchs.txt | 1 + .gen/objs.txt | 30 ++++++++++++++++++++++++++++++ .gen/service.txt | 1 + .gen/unittest.txt | 1 + benchs/hello_benchmark.cpp | 3 ++- 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .gen/benchs.txt create mode 100644 .gen/objs.txt create mode 100644 .gen/service.txt create mode 100644 .gen/unittest.txt diff --git a/.gen/benchs.txt b/.gen/benchs.txt new file mode 100644 index 00000000..0efe48d1 --- /dev/null +++ b/.gen/benchs.txt @@ -0,0 +1 @@ +benchs/hello_benchmark.cpp diff --git a/.gen/objs.txt b/.gen/objs.txt new file mode 100644 index 00000000..3455e758 --- /dev/null +++ b/.gen/objs.txt @@ -0,0 +1,30 @@ +src/utils/json_type.hpp +src/utils/component_list_fwd.hpp +src/utils/json_type.cpp +src/views/login/view.hpp +src/views/login/Request.cpp +src/views/login/view.cpp +src/views/login/Request.hpp +src/views/hello/view.hpp +src/views/hello/view.cpp +src/views/register/view.hpp +src/views/register/Request.cpp +src/views/register/view.cpp +src/views/register/Request.hpp +src/http/handler_parsed.hpp +src/models/auth_token/serialize.hpp +src/models/auth_token/type.hpp +src/models/user/postgre.hpp +src/models/user/type.hpp +src/models/user_type/parse.hpp +src/models/user_type/parse.cpp +src/models/user_type/postgre.hpp +src/models/user_type/type.hpp +src/components/controllers/user_controller_fwd.cpp +src/components/controllers/user_controller_fwd.hpp +src/components/controllers/token_controller_fwd.hpp +src/components/controllers/user_controller.hpp +src/components/controllers/user_controller.cpp +src/components/controllers/token_controller.hpp +src/components/controllers/token_controller_fwd.cpp +src/components/controllers/token_controller.cpp diff --git a/.gen/service.txt b/.gen/service.txt new file mode 100644 index 00000000..d24bf269 --- /dev/null +++ b/.gen/service.txt @@ -0,0 +1 @@ +service/main.cpp diff --git a/.gen/unittest.txt b/.gen/unittest.txt new file mode 100644 index 00000000..72ba6f85 --- /dev/null +++ b/.gen/unittest.txt @@ -0,0 +1 @@ +utests/hello_test.cpp diff --git a/benchs/hello_benchmark.cpp b/benchs/hello_benchmark.cpp index 22109938..b2d61f05 100644 --- a/benchs/hello_benchmark.cpp +++ b/benchs/hello_benchmark.cpp @@ -14,7 +14,8 @@ void HelloBenchmark(benchmark::State& state) { for (auto _ : state) { const auto name = kNames[i++ % std::size(kNames)]; - auto result = service_template::SayHelloTo(name, service_template::UserType::kKnown); + auto result = service_template::SayHelloTo( + name, service_template::UserType::kKnown); benchmark::DoNotOptimize(result); } }); From d651afffa041b65823bb7153f394582fd3c8af90 Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:08:59 +0000 Subject: [PATCH 05/11] - --- .gen/benchs.txt | 1 - Makefile | 15 ++++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gen/benchs.txt b/.gen/benchs.txt index 0efe48d1..e69de29b 100644 --- a/.gen/benchs.txt +++ b/.gen/benchs.txt @@ -1 +0,0 @@ -benchs/hello_benchmark.cpp diff --git a/Makefile b/Makefile index 2403ceec..4ef1db48 100644 --- a/Makefile +++ b/Makefile @@ -82,11 +82,16 @@ format: format-cpp .PHONY: check-git-status check-git-status: - @if [ -n "`git status -s`" ]; then \ - echo "There are uncommitted files:" >&2; \ - git status -s >&2 ; \ - exit 1; \ - fi + @echo "Checking if all files are committed to git..." + @if [ -n "$$(git status --porcelain)" ]; then \ + echo "The following files are not committed:"; \ + git status --short; \ + echo "Please commit all changes and try again."; \ + git diff --color | cat; \ + exit 1; \ + else \ + echo "All files are committed to git."; \ + fi .PHONY: gen gen: From fa6ee5fb922011861648247a0e21104b3e4d22dc Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:10:30 +0000 Subject: [PATCH 06/11] - --- .gen/benchs.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/.gen/benchs.txt b/.gen/benchs.txt index e69de29b..0efe48d1 100644 --- a/.gen/benchs.txt +++ b/.gen/benchs.txt @@ -0,0 +1 @@ +benchs/hello_benchmark.cpp From 9052cd2909994952db06051555eaaa37d644c18f Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:21:58 +0000 Subject: [PATCH 07/11] - --- .github/workflows/ci.yml | 9 +++++---- .github/workflows/docker.yaml | 9 +++++---- CMakeLists.txt | 4 ++-- Makefile | 10 ++++++++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63d7d6c7..3ede11c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,12 +31,13 @@ jobs: with: submodules: true - - name: Format sources and gen list of them + - name: Check format sources + run: | + make check-format + - name: Gen list of source and check diffs with commit run: | make gen - make format-all - - name: Check git status - run: make check-git-status + make check-git-status - name: Reuse ccache directory uses: actions/cache@v2 with: diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index ce554cb1..5cc1678b 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -15,12 +15,13 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: Format sources and gen list of them + - name: Check format sources run: | - make gen - make format-all + make check-format - name: Check git status - run: make check-git-status + run: | + make gen + make check-git-status - name: Reuse ccache directory uses: actions/cache@v2 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 913cefa2..22fc24f5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,8 @@ include(GNUInstallDirs) add_subdirectory(third_party/userver) -#make gen source lists are generated in the .gen folder +#make gen +#source lists are generated in the .gen folder file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/benchs.txt benchs_src) file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/objs.txt objs_src) file(STRINGS ${PROJECT_SOURCE_DIR}/.gen/service.txt service_src) @@ -27,7 +28,6 @@ add_executable(${PROJECT_NAME} ${service_src}) target_link_libraries(${PROJECT_NAME} PRIVATE ${PROJECT_NAME}_objs) - # Unit Tests add_executable(${PROJECT_NAME}_unittest ${unittest_src} diff --git a/Makefile b/Makefile index 4ef1db48..0915c473 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,10 @@ format-cpp: format: format-cpp @find tests -name '*.py' -type f | xargs autopep8 -i +# Check format the sources +.PHONY: check-format +check-format: check-format-cpp + .PHONY: check-git-status check-git-status: @echo "Checking if all files are committed to git..." @@ -93,6 +97,12 @@ check-git-status: echo "All files are committed to git."; \ fi +.PHONY: check-format-cpp +check-format-cpp: + @find benchs -name '*pp' -type f | xargs $(CLANG_FORMAT) -i --dry-run --Werror + @find service -name '*pp' -type f | xargs $(CLANG_FORMAT) -i --dry-run --Werror + @find src -name '*pp' -type f | xargs $(CLANG_FORMAT) -i --dry-run --Werror + @find utests -name '*pp' -type f | xargs $(CLANG_FORMAT) -i --dry-run --Werror .PHONY: gen gen: @rm -rf .gen From 7d2d9c414fe78d47f3407a65cd7869a96e7f31c6 Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:28:08 +0000 Subject: [PATCH 08/11] fix unsort in gen file --- .gen/objs.txt | 44 ++++++++++++++++++++++---------------------- Makefile | 8 ++++++++ 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/.gen/objs.txt b/.gen/objs.txt index 3455e758..94cb01ba 100644 --- a/.gen/objs.txt +++ b/.gen/objs.txt @@ -1,30 +1,30 @@ -src/utils/json_type.hpp -src/utils/component_list_fwd.hpp -src/utils/json_type.cpp -src/views/login/view.hpp -src/views/login/Request.cpp -src/views/login/view.cpp -src/views/login/Request.hpp -src/views/hello/view.hpp -src/views/hello/view.cpp -src/views/register/view.hpp -src/views/register/Request.cpp -src/views/register/view.cpp -src/views/register/Request.hpp +src/components/controllers/token_controller.cpp +src/components/controllers/token_controller_fwd.cpp +src/components/controllers/token_controller_fwd.hpp +src/components/controllers/token_controller.hpp +src/components/controllers/user_controller.cpp +src/components/controllers/user_controller_fwd.cpp +src/components/controllers/user_controller_fwd.hpp +src/components/controllers/user_controller.hpp src/http/handler_parsed.hpp src/models/auth_token/serialize.hpp src/models/auth_token/type.hpp src/models/user/postgre.hpp src/models/user/type.hpp -src/models/user_type/parse.hpp src/models/user_type/parse.cpp +src/models/user_type/parse.hpp src/models/user_type/postgre.hpp src/models/user_type/type.hpp -src/components/controllers/user_controller_fwd.cpp -src/components/controllers/user_controller_fwd.hpp -src/components/controllers/token_controller_fwd.hpp -src/components/controllers/user_controller.hpp -src/components/controllers/user_controller.cpp -src/components/controllers/token_controller.hpp -src/components/controllers/token_controller_fwd.cpp -src/components/controllers/token_controller.cpp +src/utils/component_list_fwd.hpp +src/utils/json_type.cpp +src/utils/json_type.hpp +src/views/hello/view.cpp +src/views/hello/view.hpp +src/views/login/Request.cpp +src/views/login/Request.hpp +src/views/login/view.cpp +src/views/login/view.hpp +src/views/register/Request.cpp +src/views/register/Request.hpp +src/views/register/view.cpp +src/views/register/view.hpp diff --git a/Makefile b/Makefile index 0915c473..54ba6494 100644 --- a/Makefile +++ b/Makefile @@ -107,10 +107,18 @@ check-format-cpp: gen: @rm -rf .gen @mkdir -p .gen + @find benchs -name '*pp' > .gen/benchs.txt + @sort .gen/benchs.txt -o .gen/benchs.txt + @find src -name '*pp' > .gen/objs.txt + @sort .gen/objs.txt -o .gen/objs.txt + @find service -name '*pp' > .gen/service.txt + @sort .gen/service.txt -o .gen/service.txt + @find utests -name '*pp' > .gen/unittest.txt + @sort .gen/unittest.txt -o .gen/unittest.txt # Internal hidden targets that are used only in docker environment --in-docker-start-debug --in-docker-start-release: --in-docker-start-%: install-% From 58c4da4e022ecd0abf37041aecb50788f680dcfa Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:32:41 +0000 Subject: [PATCH 09/11] - --- .gen/objs.txt | 58 +++++++++++++++++++++++++-------------------------- Makefile | 8 +++---- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/.gen/objs.txt b/.gen/objs.txt index 94cb01ba..b12b2878 100644 --- a/.gen/objs.txt +++ b/.gen/objs.txt @@ -1,30 +1,30 @@ -src/components/controllers/token_controller.cpp -src/components/controllers/token_controller_fwd.cpp -src/components/controllers/token_controller_fwd.hpp -src/components/controllers/token_controller.hpp -src/components/controllers/user_controller.cpp -src/components/controllers/user_controller_fwd.cpp -src/components/controllers/user_controller_fwd.hpp -src/components/controllers/user_controller.hpp -src/http/handler_parsed.hpp -src/models/auth_token/serialize.hpp -src/models/auth_token/type.hpp -src/models/user/postgre.hpp -src/models/user/type.hpp -src/models/user_type/parse.cpp -src/models/user_type/parse.hpp -src/models/user_type/postgre.hpp -src/models/user_type/type.hpp -src/utils/component_list_fwd.hpp -src/utils/json_type.cpp -src/utils/json_type.hpp -src/views/hello/view.cpp -src/views/hello/view.hpp -src/views/login/Request.cpp -src/views/login/Request.hpp -src/views/login/view.cpp -src/views/login/view.hpp -src/views/register/Request.cpp -src/views/register/Request.hpp -src/views/register/view.cpp src/views/register/view.hpp +src/views/register/view.cpp +src/views/register/Request.hpp +src/views/register/Request.cpp +src/views/login/view.hpp +src/views/login/view.cpp +src/views/login/Request.hpp +src/views/login/Request.cpp +src/views/hello/view.hpp +src/views/hello/view.cpp +src/utils/json_type.hpp +src/utils/json_type.cpp +src/utils/component_list_fwd.hpp +src/models/user_type/type.hpp +src/models/user_type/postgre.hpp +src/models/user_type/parse.hpp +src/models/user_type/parse.cpp +src/models/user/type.hpp +src/models/user/postgre.hpp +src/models/auth_token/type.hpp +src/models/auth_token/serialize.hpp +src/http/handler_parsed.hpp +src/components/controllers/user_controller.hpp +src/components/controllers/user_controller_fwd.hpp +src/components/controllers/user_controller_fwd.cpp +src/components/controllers/user_controller.cpp +src/components/controllers/token_controller.hpp +src/components/controllers/token_controller_fwd.hpp +src/components/controllers/token_controller_fwd.cpp +src/components/controllers/token_controller.cpp diff --git a/Makefile b/Makefile index 54ba6494..b5eb22d7 100644 --- a/Makefile +++ b/Makefile @@ -109,16 +109,16 @@ gen: @mkdir -p .gen @find benchs -name '*pp' > .gen/benchs.txt - @sort .gen/benchs.txt -o .gen/benchs.txt + @sort .gen/benchs.txt -r -o .gen/benchs.txt @find src -name '*pp' > .gen/objs.txt - @sort .gen/objs.txt -o .gen/objs.txt + @sort .gen/objs.txt -r -o .gen/objs.txt @find service -name '*pp' > .gen/service.txt - @sort .gen/service.txt -o .gen/service.txt + @sort .gen/service.txt -r -o .gen/service.txt @find utests -name '*pp' > .gen/unittest.txt - @sort .gen/unittest.txt -o .gen/unittest.txt + @sort .gen/unittest.txt -r -o .gen/unittest.txt # Internal hidden targets that are used only in docker environment --in-docker-start-debug --in-docker-start-release: --in-docker-start-%: install-% From b49e2fb0fd5e2e491c5d57b326e1d5e28e759200 Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:38:49 +0000 Subject: [PATCH 10/11] another fix --- .gen/objs.txt | 4 ++-- Makefile | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.gen/objs.txt b/.gen/objs.txt index b12b2878..35bcec7c 100644 --- a/.gen/objs.txt +++ b/.gen/objs.txt @@ -20,11 +20,11 @@ src/models/user/postgre.hpp src/models/auth_token/type.hpp src/models/auth_token/serialize.hpp src/http/handler_parsed.hpp -src/components/controllers/user_controller.hpp src/components/controllers/user_controller_fwd.hpp src/components/controllers/user_controller_fwd.cpp +src/components/controllers/user_controller.hpp src/components/controllers/user_controller.cpp -src/components/controllers/token_controller.hpp src/components/controllers/token_controller_fwd.hpp src/components/controllers/token_controller_fwd.cpp +src/components/controllers/token_controller.hpp src/components/controllers/token_controller.cpp diff --git a/Makefile b/Makefile index b5eb22d7..0935d104 100644 --- a/Makefile +++ b/Makefile @@ -109,16 +109,16 @@ gen: @mkdir -p .gen @find benchs -name '*pp' > .gen/benchs.txt - @sort .gen/benchs.txt -r -o .gen/benchs.txt + @LC_COLLATE=C sort .gen/benchs.txt -r -o .gen/benchs.txt @find src -name '*pp' > .gen/objs.txt - @sort .gen/objs.txt -r -o .gen/objs.txt + @LC_COLLATE=C sort .gen/objs.txt -r -o .gen/objs.txt @find service -name '*pp' > .gen/service.txt - @sort .gen/service.txt -r -o .gen/service.txt + @LC_COLLATE=C sort .gen/service.txt -r -o .gen/service.txt @find utests -name '*pp' > .gen/unittest.txt - @sort .gen/unittest.txt -r -o .gen/unittest.txt + @LC_COLLATE=C sort .gen/unittest.txt -r -o .gen/unittest.txt # Internal hidden targets that are used only in docker environment --in-docker-start-debug --in-docker-start-release: --in-docker-start-%: install-% From 650ff75e6aa672a27ef643c9c1fb02cfc76b9a5d Mon Sep 17 00:00:00 2001 From: sabudilovskiy Date: Sat, 1 Apr 2023 11:41:42 +0000 Subject: [PATCH 11/11] fix make --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 0935d104..2fa55cd9 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build_release/Makefile: # Run cmake .PHONY: cmake-debug cmake-release -cmake-debug cmake-release: cmake-%: build_%/Makefile: +cmake-debug cmake-release: cmake-%: build_%/Makefile # Build using cmake .PHONY: build-debug build-release