diff --git a/.clang-format b/.clang-format index 2ce3d17..8058527 100644 --- a/.clang-format +++ b/.clang-format @@ -152,5 +152,4 @@ SpacesInParentheses: false SpacesInSquareBrackets: false Standard: Latest TabWidth: 4 -UseTab: Never -... \ No newline at end of file +UseTab: Never \ No newline at end of file diff --git a/.clang-tidy b/.clang-tidy index 5b17e31..20f298b 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,10 +1,14 @@ --- -Checks: '*,-modernize-use-nodiscard' +Checks: '*,-modernize-use-nodiscard,-llvmlibc-*,-fuchsia-trailing-return,-fuchsia*,-altera-*' WarningsAsErrors: '' HeaderFilterRegex: '' AnalyzeTemporaryDtors: false FormatStyle: file CheckOptions: + - key: readability-braces-around-statements.ShortStatementLines + value: '1' + - key: hicpp-braces-around-statements.ShortStatementLines + value: '1' - key: bugprone-use-after-move value: '1' - key: bugprone-assert-side-effect.AssertMacros @@ -40,5 +44,4 @@ CheckOptions: - key: hicpp-special-member-functions.AllowMissingMoveFunctions value: '0' - key: hicpp-special-member-functions.AllowSoleDefaultDtor - value: '0' -... \ No newline at end of file + value: '0' \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 6c64abe..9a0183c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,4 +9,5 @@ } } ], + "editor.formatOnSave": true, } \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 513593a..a137697 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,10 @@ list(APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR}/extras) include(CTest) include(Catch) -set(CMAKE_C_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang) -set(CMAKE_CXX_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang++) +if(APPLE) + set(CMAKE_C_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang) + set(CMAKE_CXX_COMPILER /opt/homebrew/Cellar/llvm@16/16.0.6/bin/clang++) +endif() SET(CALCULATOR_CHALLENGE_SOURCES Calculator.cpp diff --git a/Calculator.cpp b/Calculator.cpp index 8367ed9..17c6c10 100644 --- a/Calculator.cpp +++ b/Calculator.cpp @@ -1,5 +1,6 @@ #include "Calculator.hpp" +#include #include #include diff --git a/Calculator.hpp b/Calculator.hpp index ae5eb59..b17ea7f 100644 --- a/Calculator.hpp +++ b/Calculator.hpp @@ -1,10 +1,9 @@ -#ifndef CALCULATOR_CHALLENGE_WORKSPACE_HPP -#define CALCULATOR_CHALLENGE_WORKSPACE_HPP +#ifndef CALCULATOR_CHALLENGE_CALCULATOR_HPP +#define CALCULATOR_CHALLENGE_CALCULATOR_HPP -#include -#include +#include #include -#include +#include #include #include "Operand.hpp" diff --git a/CalculatorCli.cpp b/CalculatorCli.cpp index 2a7a44c..e2c864f 100644 --- a/CalculatorCli.cpp +++ b/CalculatorCli.cpp @@ -27,7 +27,7 @@ struct OperationMembers }; template -auto text_to_number(std::string_view text) noexcept +auto text_to_number(std::string_view text) noexcept -> T { if (text.empty()) return T{};