diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 000000000..07c395c81 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,68 @@ +# Generated from CLion Inspection settings +--- +Checks: '-*, +mpi-*, +bugprone-*, +-bugprone-signal-handler, +-bugprone-narrowing-conversions, +-bugprone-redundant-branch-condition, +-bugprone-exception-escape, +-bugprone-shared-ptr-array-mismatch, +-bugprone-implicit-widening-of-multiplication-result, +-bugprone-signed-char-misuse, +-bugprone-unhandled-exception-at-new, +-bugprone-infinite-loop, +-bugprone-easily-swappable-parameters, +cert-err52-cpp, +cert-err60-cpp, +cert-err34-c, +cert-str34-c, +cert-dcl21-cpp, +cert-msc50-cpp, +cert-msc51-cpp, +cert-dcl58-cpp, +cert-flp30-c, +cppcoreguidelines-avoid-const-or-ref-data-members, +cppcoreguidelines-pro-type-member-init, +cppcoreguidelines-slicing, +cppcoreguidelines-interfaces-global-init, +cppcoreguidelines-pro-type-static-cast-downcast, +cppcoreguidelines-avoid-capture-default-when-capturing-this, +cppcoreguidelines-narrowing-conversions, +google-default-arguments, +google-runtime-operator, +google-explicit-constructor, +hicpp-multiway-paths-covered, +hicpp-exception-baseclass, +misc-*, +-misc-definitions-in-headers, +-misc-unused-parameters, +-misc-unused-alias-decls, +-misc-use-anonymous-namespace, +-misc-misleading-identifier, +-misc-confusable-identifiers, +-misc-misleading-bidirectional, +-misc-static-assert, +-misc-no-recursion, +-misc-const-correctness, +modernize-*, +-modernize-use-trailing-return-type, +openmp-use-default-none, +performance-*, +-performance-no-int-to-ptr, +portability-*, +-portability-restrict-system-includes, +readability-*, +-readability-redundant-preprocessor, +-readability-named-parameter, +-readability-function-size, +-readability-use-anyofallof, +-readability-identifier-length, +-readability-magic-numbers, +-readability-braces-around-statements, +-readability-suspicious-call-argument, +-readability-isolate-declaration, +-readability-else-after-return, +-readability-redundant-access-specifiers, +-readability-function-cognitive-complexity, +-readability-identifier-naming' \ No newline at end of file diff --git a/main/source/init/splash_window.cpp b/main/source/init/splash_window.cpp index 0538a15dd..551dec29a 100644 --- a/main/source/init/splash_window.cpp +++ b/main/source/init/splash_window.cpp @@ -126,8 +126,8 @@ namespace hex::init { drawList->AddText(ImVec2(15, 120) * scale, ImColor(0xFF, 0xFF, 0xFF, 0xFF), hex::format("WerWolv 2020 - {0}", &__DATE__[7]).c_str()); - #if defined(DEBUG) && defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH) - drawList->AddText(ImVec2(15, 140) * scale, ImColor(0xFF, 0xFF, 0xFF, 0xFF), hex::format("{0} : {1} {2}@{3}", IMHEX_VERSION, ICON_FA_CODE_BRANCH, GIT_BRANCH, GIT_COMMIT_HASH).c_str()); + #if defined(DEBUG) && defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH_SHORT) + drawList->AddText(ImVec2(15, 140) * scale, ImColor(0xFF, 0xFF, 0xFF, 0xFF), hex::format("{0} : {1} {2}@{3}", IMHEX_VERSION, ICON_FA_CODE_BRANCH, GIT_BRANCH, GIT_COMMIT_HASH_SHORT).c_str()); #else drawList->AddText(ImVec2(15, 140) * scale, ImColor(0xFF, 0xFF, 0xFF, 0xFF), hex::format("{0}", IMHEX_VERSION).c_str()); #endif diff --git a/main/source/init/tasks.cpp b/main/source/init/tasks.cpp index eb93a3666..be23bc59c 100644 --- a/main/source/init/tasks.cpp +++ b/main/source/init/tasks.cpp @@ -1,7 +1,6 @@ #include "init/tasks.hpp" #include -#include #include #include diff --git a/main/source/main.cpp b/main/source/main.cpp index 25bdea9f2..704ba7687 100644 --- a/main/source/main.cpp +++ b/main/source/main.cpp @@ -28,7 +28,7 @@ int main(int argc, char **argv, char **envp) { bool shouldRestart = false; do { - // Register a event to handle restarting of ImHex + // Register an event to handle restarting of ImHex EventManager::subscribe([&]{ shouldRestart = true; }); shouldRestart = false; diff --git a/plugins/builtin/source/content/views/view_about.cpp b/plugins/builtin/source/content/views/view_about.cpp index 5adcb8379..00eaaa880 100644 --- a/plugins/builtin/source/content/views/view_about.cpp +++ b/plugins/builtin/source/content/views/view_about.cpp @@ -54,11 +54,11 @@ namespace hex::plugin::builtin { ImGui::TextFormatted("ImHex Hex Editor v{} by WerWolv - " ICON_FA_CODE_BRANCH, IMHEX_VERSION); -#if defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH) - ImGui::SameLine(); - if (ImGui::Hyperlink(hex::format("{0}@{1}", GIT_BRANCH, GIT_COMMIT_HASH).c_str())) - hex::openWebpage("https://github.com/WerWolv/ImHex/commit/" GIT_COMMIT_HASH); -#endif + #if defined(GIT_BRANCH) && defined(GIT_COMMIT_HASH_SHORT) && defined(GIT_COMMIT_HASH_LONG) + ImGui::SameLine(); + if (ImGui::Hyperlink(hex::format("{0}@{1}", GIT_BRANCH, GIT_COMMIT_HASH_SHORT).c_str())) + hex::openWebpage("https://github.com/WerWolv/ImHex/commit/" GIT_COMMIT_HASH_LONG); + #endif ImGui::TextUnformatted("hex.builtin.view.help.about.translator"_lang);