mirror of
https://github.com/BlackMATov/enum.hpp.git
synced 2025-12-13 06:59:45 +07:00
add clang-tidy checks
This commit is contained in:
21
.clang-tidy
Normal file
21
.clang-tidy
Normal 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-*,
|
||||
'
|
||||
...
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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
18
untests/.clang-tidy
Normal 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-*,
|
||||
'
|
||||
...
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user