Skip to content

Commit

Permalink
[clang-tidy] Enable misc-include-cleaner
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkaratarakis committed Jun 17, 2024
1 parent 8d9ad90 commit e5842cc
Show file tree
Hide file tree
Showing 39 changed files with 228 additions and 15 deletions.
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ Checks: >
-google-readability-namespace-comments,
-misc-non-private-member-variables-in-classes,
-misc-const-correctness,
-misc-include-cleaner,
-modernize-return-braced-init-list,
-modernize-use-trailing-return-type,
-modernize-avoid-c-arrays,
Expand Down
30 changes: 30 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,9 @@ cc_library(
hdrs = ["include/fixed_containers/fixed_unordered_set_raw_view.hpp"],
includes = ["include"],
deps = [
":concepts",
":fixed_doubly_linked_list_raw_view",
":map_entry",
],
copts = ["-std=c++20"],
)
Expand Down Expand Up @@ -864,6 +866,7 @@ cc_test(
srcs = ["test/circular_indexing_test.cpp"],
deps = [
":circular_indexing",
":integer_range",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand All @@ -876,6 +879,9 @@ cc_test(
deps = [
":concepts",
":circular_integer_range_iterator",
":integer_range",
":iterator_utils",
":random_access_iterator",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand Down Expand Up @@ -914,6 +920,8 @@ cc_test(
":enum_array",
":enums_test_common",
":mock_testing_types",
":ranges",
"@com_github_neargye_magic_enum//:magic_enum",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand All @@ -924,7 +932,9 @@ cc_test(
name = "enum_map_test",
srcs = ["test/enum_map_test.cpp"],
deps = [
":arrow_proxy",
":assert_or_abort",
":concepts",
":consteval_compare",
":enum_map",
":enums_test_common",
Expand All @@ -944,6 +954,7 @@ cc_test(
srcs = ["test/enum_set_test.cpp"],
deps = [
":assert_or_abort",
":concepts",
":consteval_compare",
":enum_set",
":enums_test_common",
Expand All @@ -959,6 +970,7 @@ cc_test(
name = "enum_utils_test",
srcs = ["test/enum_utils_test.cpp"],
deps = [
":concepts",
":consteval_compare",
":enum_utils",
":enums_test_common",
Expand All @@ -972,7 +984,10 @@ cc_test(
name = "filtered_integer_range_iterator_test",
srcs = ["test/filtered_integer_range_iterator_test.cpp"],
deps = [
":bidirectional_iterator",
":concepts",
":integer_range",
":iterator_utils",
":filtered_integer_range_iterator",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
Expand All @@ -985,6 +1000,7 @@ cc_test(
srcs = ["test/fixed_circular_deque_test.cpp"],
deps = [
":assert_or_abort",
":concepts",
":fixed_circular_deque",
":instance_counter",
":max_size",
Expand All @@ -1000,6 +1016,7 @@ cc_test(
name = "fixed_circular_queue_test",
srcs = ["test/fixed_circular_queue_test.cpp"],
deps = [
":concepts",
":fixed_circular_queue",
":fixed_vector",
":max_size",
Expand Down Expand Up @@ -1057,7 +1074,10 @@ cc_test(
srcs = ["test/fixed_map_perf_test.cpp"],
deps = [
":consteval_compare",
":fixed_index_based_storage",
":fixed_map",
":fixed_red_black_tree",
"@com_google_googletest//:gtest_main",
"@com_google_benchmark//:benchmark_main",
],
copts = ["-std=c++20"],
Expand Down Expand Up @@ -1085,6 +1105,7 @@ cc_test(
name = "fixed_map_test",
srcs = ["test/fixed_map_test.cpp"],
deps = [
":arrow_proxy",
":assert_or_abort",
":concepts",
":consteval_compare",
Expand All @@ -1104,8 +1125,10 @@ cc_test(
name = "fixed_unordered_map_test",
srcs = ["test/fixed_unordered_map_test.cpp"],
deps = [
":arrow_proxy",
":concepts",
":consteval_compare",
":fixed_map_adapter",
":fixed_unordered_map",
":instance_counter",
":max_size",
Expand Down Expand Up @@ -1139,6 +1162,7 @@ cc_test(
deps = [
":concepts",
":consteval_compare",
":fixed_set_adapter",
":fixed_unordered_set",
":instance_counter",
":max_size",
Expand Down Expand Up @@ -1171,6 +1195,7 @@ cc_test(
deps = [
":concepts",
":consteval_compare",
":fixed_index_based_storage",
":fixed_red_black_tree",
":mock_testing_types",
"@com_google_googletest//:gtest",
Expand All @@ -1184,7 +1209,9 @@ cc_test(
srcs = ["test/fixed_red_black_tree_view_test.cpp"],
deps = [
":fixed_red_black_tree_view",
":fixed_red_black_tree",
":fixed_set",
":fixed_vector",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
Expand Down Expand Up @@ -1417,6 +1444,7 @@ cc_test(
name = "queue_adapter_test",
srcs = ["test/queue_adapter_test.cpp"],
deps = [
":concepts",
":fixed_deque",
":queue_adapter",
"@com_google_googletest//:gtest",
Expand All @@ -1429,6 +1457,7 @@ cc_test(
name = "optional_reference_test",
srcs = ["test/optional_reference_test.cpp"],
deps = [
":concepts",
":optional_reference",
":mock_testing_types",
"@com_google_googletest//:gtest",
Expand Down Expand Up @@ -1456,6 +1485,7 @@ cc_test(
name = "stack_adapter_test",
srcs = ["test/stack_adapter_test.cpp"],
deps = [
":concepts",
":fixed_stack",
":stack_adapter",
"@com_google_googletest//:gtest",
Expand Down
4 changes: 4 additions & 0 deletions test/circular_indexing_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#include "fixed_containers/circular_indexing.hpp"

#include "fixed_containers/integer_range.hpp"

#include <gtest/gtest.h>

#include <cstddef>

namespace fixed_containers::circular_indexing
{
TEST(CyclesAndInteger, IncrementIndexWithWraparound)
Expand Down
3 changes: 3 additions & 0 deletions test/circular_integer_range_iterator_test.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "fixed_containers/circular_integer_range_iterator.hpp"

#include "fixed_containers/concepts.hpp"
#include "fixed_containers/integer_range.hpp"
#include "fixed_containers/iterator_utils.hpp"
#include "fixed_containers/random_access_iterator.hpp"

#include <gtest/gtest.h>

Expand Down
2 changes: 2 additions & 0 deletions test/concepts_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include "fixed_containers/assert_or_abort.hpp"

#include <functional>

namespace fixed_containers
{
static_assert(!IsTransparent<std::less<int>>);
Expand Down
6 changes: 6 additions & 0 deletions test/enum_array_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,16 @@

#include "fixed_containers/concepts.hpp"
#include "fixed_containers/consteval_compare.hpp"
#include "fixed_containers/ranges.hpp"

#include <gtest/gtest.h>
#include <magic_enum.hpp>

#include <array>
#include <cstddef>
#include <iterator>
#include <memory>
#include <utility>

namespace fixed_containers
{
Expand Down
7 changes: 7 additions & 0 deletions test/enum_map_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
#include "mock_testing_types.hpp"
#include "test_utilities_common.hpp"

#include "fixed_containers/arrow_proxy.hpp"
#include "fixed_containers/assert_or_abort.hpp"
#include "fixed_containers/concepts.hpp"
#include "fixed_containers/consteval_compare.hpp"
#include "fixed_containers/max_size.hpp"

#include <gtest/gtest.h>
#include <range/v3/iterator/concepts.hpp>
#include <range/v3/iterator/operations.hpp>
#include <range/v3/view/filter.hpp>

#include <array>
#include <cstddef>
#include <iterator>
#include <map>
#include <memory>
#include <tuple>
#include <type_traits>
#include <utility>

Expand Down
4 changes: 4 additions & 0 deletions test/enum_set_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
#include "enums_test_common.hpp"

#include "fixed_containers/assert_or_abort.hpp"
#include "fixed_containers/concepts.hpp"
#include "fixed_containers/consteval_compare.hpp"
#include "fixed_containers/max_size.hpp"

#include <gtest/gtest.h>
#include <range/v3/iterator/operations.hpp>
#include <range/v3/view/filter.hpp>

#include <algorithm>
#include <array>
#include <cstddef>
#include <iterator>
#include <type_traits>

Expand Down
2 changes: 2 additions & 0 deletions test/enum_utils_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@

#include "enums_test_common.hpp"

#include "fixed_containers/concepts.hpp"
#include "fixed_containers/consteval_compare.hpp"

#include <gtest/gtest.h>

#include <cstddef>
#include <optional>
#include <type_traits>

namespace fixed_containers::rich_enums_detail
Expand Down
4 changes: 4 additions & 0 deletions test/filtered_integer_range_iterator_test.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#include "fixed_containers/filtered_integer_range_iterator.hpp"

#include "fixed_containers/bidirectional_iterator.hpp"
#include "fixed_containers/concepts.hpp"
#include "fixed_containers/integer_range.hpp"
#include "fixed_containers/iterator_utils.hpp"

#include <gtest/gtest.h>

#include <array>
#include <cstddef>
#include <iterator>
#include <ranges>
#include <vector>

Expand Down
6 changes: 6 additions & 0 deletions test/fixed_circular_deque_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
#include "test_utilities_common.hpp"

#include "fixed_containers/assert_or_abort.hpp"
#include "fixed_containers/concepts.hpp"
#include "fixed_containers/max_size.hpp"

#include <gtest/gtest.h>

#include <algorithm>
#include <array>
#include <cstddef>
#include <deque>
#include <initializer_list>
#include <limits>
#include <type_traits>

namespace fixed_containers
{
Expand Down
3 changes: 3 additions & 0 deletions test/fixed_circular_queue_test.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#include "fixed_containers/fixed_circular_queue.hpp"

#include "fixed_containers/concepts.hpp"
#include "fixed_containers/fixed_vector.hpp"
#include "fixed_containers/max_size.hpp"

#include <gtest/gtest.h>

#include <array>

namespace fixed_containers
{

Expand Down
8 changes: 7 additions & 1 deletion test/fixed_deque_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@
#include <gtest/gtest.h>

#include <algorithm>
#include <array>
#include <cstddef>
#include <deque>
#include <initializer_list>
#include <limits>
#include <type_traits>
#include <utility>

namespace fixed_containers
{
Expand Down Expand Up @@ -1201,7 +1207,7 @@ TEST(FixedDeque, Resize_ExceedsCapacity)
auto v1 = Factory::template create<int, 3>();
EXPECT_DEATH(v1.resize(6), "");
EXPECT_DEATH(v1.resize(6, 5), "");
const size_t to_size = 7;
const std::size_t to_size = 7;
EXPECT_DEATH(v1.resize(to_size), "");
EXPECT_DEATH(v1.resize(to_size, 5), "");
};
Expand Down
5 changes: 5 additions & 0 deletions test/fixed_doubly_linked_list_raw_view_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

#include <gtest/gtest.h>

#include <cstddef>
#include <cstdint>
#include <iterator>
#include <ranges>

namespace fixed_containers::fixed_doubly_linked_list_detail
{
namespace
Expand Down
2 changes: 2 additions & 0 deletions test/fixed_doubly_linked_list_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <gtest/gtest.h>

#include <cstddef>

namespace fixed_containers::fixed_doubly_linked_list_detail
{
namespace
Expand Down
Loading

0 comments on commit e5842cc

Please sign in to comment.