From 79a5919df90af64cd9a59568d5f1cf398e51ad90 Mon Sep 17 00:00:00 2001 From: Shaun Reed Date: Sun, 20 Nov 2022 10:00:30 -0500 Subject: [PATCH] Format and fix tidy CI --- .github/workflows/clang-tidy-format.yml | 8 ++++++++ README.md | 11 +++++++++-- src/qtkapi.h | 12 ++++++------ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/clang-tidy-format.yml b/.github/workflows/clang-tidy-format.yml index a4fb9d5..e654516 100644 --- a/.github/workflows/clang-tidy-format.yml +++ b/.github/workflows/clang-tidy-format.yml @@ -11,6 +11,14 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install Qt + uses: jurplel/install-qt-action@v2 + with: + version: '6.3.1' + + - name: Install Assimp Ubuntu + run: sudo apt install libassimp-dev + - name: Build Qtk run: | cmake -B build && cmake --build build diff --git a/README.md b/README.md index 83cd583..1897845 100644 --- a/README.md +++ b/README.md @@ -87,8 +87,15 @@ cd build clang-tidy --fix --config-file=../.clang-tidy ../src/*.cpp ../src/*.h ../app/*.cpp ../app/*.h ``` -And finally `clang-format` can be run with git integration (or CLion if you prefer). -Don't forget to commit the reformatted files. +Last we need to run `clang-format`, this can be done with the command directly. +This will reformat all the code in the repository. + +```bash +clang-format -i --style=file:.clang-format src/*.cpp src/*.h app/*.cpp app/*.h +``` + +`clang-format` can be run with git integration (or CLion if you prefer). +Git will only reformat the lines you modified, which can be useful. ```bash # If we want to format the last N commits diff --git a/src/qtkapi.h b/src/qtkapi.h index 1329e20..088a1fd 100644 --- a/src/qtkapi.h +++ b/src/qtkapi.h @@ -11,13 +11,13 @@ #include #ifdef QTK_SHARED -# if defined(QTK_EXPORT) -# define QTKAPI Q_DECL_EXPORT -# else -# define QTKAPI Q_DECL_IMPORT -# endif +#if defined(QTK_EXPORT) +#define QTKAPI Q_DECL_EXPORT #else -# define QTKAPI +#define QTKAPI Q_DECL_IMPORT +#endif +#else +#define QTKAPI #endif #endif // QTK_QTKAPI_H