diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..747cb57 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,21 @@ +--- +Checks: '-*, + + clang-analyzer-*, + + concurrency-*, + + cppcoreguidelines-*, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-pro-bounds-constant-array-index, + + modernize-*, + -modernize-use-trailing-return-type, + + performance-*, + + portability-*, + + readability-*, + ' +... diff --git a/CMakeLists.txt b/CMakeLists.txt index f0841cd..fac4bd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,12 +22,11 @@ target_compile_options(${PROJECT_NAME} -Wno-old-style-cast -Wno-shadow -Wno-unknown-warning-option - -Wno-weak-vtables>) + -Wno-unused-macros + -Wno-weak-vtables + >) if(BUILD_AS_STANDALONE) - option(BUILD_WITH_UNTESTS "Build with unit tests" ON) - if(BUILD_WITH_UNTESTS) - enable_testing() - add_subdirectory(untests) - endif() + enable_testing() + add_subdirectory(untests) endif() diff --git a/LICENSE.md b/LICENSE.md index 22e6e0f..33252ab 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) +Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/headers/enum.hpp/enum.hpp b/headers/enum.hpp/enum.hpp index b1e67cb..6cbe035 100644 --- a/headers/enum.hpp/enum.hpp +++ b/headers/enum.hpp/enum.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once @@ -139,7 +139,8 @@ namespace enum_hpp::detail : value(value) {} template < typename Other > - constexpr const ignore_assign& operator=(Other) const noexcept { + // NOLINTNEXTLINE(readability-named-parameter) + constexpr ignore_assign& operator=(const Other&) noexcept { return *this; } }; diff --git a/headers/enum.hpp/enum_bitflags.hpp b/headers/enum.hpp/enum_bitflags.hpp index a8645a7..5b021cb 100644 --- a/headers/enum.hpp/enum_bitflags.hpp +++ b/headers/enum.hpp/enum_bitflags.hpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #pragma once @@ -22,6 +22,9 @@ namespace enum_hpp::bitflags bitflags() = default; bitflags(const bitflags&) = default; bitflags& operator=(const bitflags&) = default; + bitflags(bitflags&&) noexcept = default; + bitflags& operator=(bitflags&&) noexcept = default; + ~bitflags() = default; constexpr bitflags(enum_type flags) : flags_(static_cast(flags)) {} diff --git a/untests/.clang-tidy b/untests/.clang-tidy new file mode 100644 index 0000000..d487769 --- /dev/null +++ b/untests/.clang-tidy @@ -0,0 +1,18 @@ +--- +Checks: '-*, + + clang-analyzer-*, + + concurrency-*, + + cppcoreguidelines-*, + -cppcoreguidelines-avoid-magic-numbers, + -cppcoreguidelines-macro-usage, + -cppcoreguidelines-pro-bounds-constant-array-index, + + modernize-*, + -modernize-use-trailing-return-type, + + portability-*, + ' +... diff --git a/untests/enum_bitflags_examples.cpp b/untests/enum_bitflags_examples.cpp index fa08927..2863d22 100644 --- a/untests/enum_bitflags_examples.cpp +++ b/untests/enum_bitflags_examples.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/enum_bitflags_tests.cpp b/untests/enum_bitflags_tests.cpp index ae4be2e..4dcf5e2 100644 --- a/untests/enum_bitflags_tests.cpp +++ b/untests/enum_bitflags_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/enum_examples.cpp b/untests/enum_examples.cpp index 9516103..653fdb6 100644 --- a/untests/enum_examples.cpp +++ b/untests/enum_examples.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include diff --git a/untests/enum_tests.cpp b/untests/enum_tests.cpp index 2b1a5cf..e5cc64b 100644 --- a/untests/enum_tests.cpp +++ b/untests/enum_tests.cpp @@ -1,7 +1,7 @@ /******************************************************************************* * This file is part of the "https://github.com/blackmatov/enum.hpp" * For conditions of distribution and use, see copyright notice in LICENSE.md - * Copyright (C) 2019-2021, by Matvey Cherevko (blackmatov@gmail.com) + * Copyright (C) 2019-2022, by Matvey Cherevko (blackmatov@gmail.com) ******************************************************************************/ #include