add clang-tidy checks

This commit is contained in:
BlackMATov
2022-01-09 16:14:44 +07:00
parent 9e9dc26923
commit c24dffafc0
10 changed files with 56 additions and 14 deletions

21
.clang-tidy Normal file
View File

@@ -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-*,
'
...

View File

@@ -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()

View File

@@ -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

View File

@@ -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;
}
};

View File

@@ -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<underlying_type>(flags)) {}

18
untests/.clang-tidy Normal file
View File

@@ -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-*,
'
...

View File

@@ -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 <enum.hpp/enum_bitflags.hpp>

View File

@@ -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 <enum.hpp/enum_bitflags.hpp>

View File

@@ -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 <enum.hpp/enum.hpp>

View File

@@ -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 <enum.hpp/enum.hpp>