diff --git a/.gitignore b/.gitignore index f6d0942..8c85227 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ # Ignore the directory in which `clangd` stores its local index. /.cache/ /.vscode/ + +MODULE.bazel diff --git a/BUILD.bazel b/BUILD.bazel index c680a00..7fdb95b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/WORKSPACE b/WORKSPACE index ca2e96b..06d9ec2 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bzl/BUILD.bazel b/bzl/BUILD.bazel index 4a7f141..af917a8 100644 --- a/bzl/BUILD.bazel +++ b/bzl/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/bzl/archive.bzl b/bzl/archive.bzl index c659b92..cc76613 100644 --- a/bzl/archive.bzl +++ b/bzl/archive.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/compile_commands-update.sh b/compile_commands-update.sh index 37542d3..02e9b05 100755 --- a/compile_commands-update.sh +++ b/compile_commands-update.sh @@ -1,6 +1,7 @@ #!/bin/bash -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/BUILD.bazel b/mbo/BUILD.bazel index 634ceb5..3a0fa8c 100644 --- a/mbo/BUILD.bazel +++ b/mbo/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/container/BUILD.bazel b/mbo/container/BUILD.bazel index aa59f70..e982a75 100644 --- a/mbo/container/BUILD.bazel +++ b/mbo/container/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/container/any_scan.h b/mbo/container/any_scan.h index 5e3697e..13fcb85 100644 --- a/mbo/container/any_scan.h +++ b/mbo/container/any_scan.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/any_scan_test.cc b/mbo/container/any_scan_test.cc index d9a94eb..71072ad 100644 --- a/mbo/container/any_scan_test.cc +++ b/mbo/container/any_scan_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/convert_container.h b/mbo/container/convert_container.h index ff2305e..d29f080 100644 --- a/mbo/container/convert_container.h +++ b/mbo/container/convert_container.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/convert_container_test.cc b/mbo/container/convert_container_test.cc index 472ab6d..1d2fb3e 100644 --- a/mbo/container/convert_container_test.cc +++ b/mbo/container/convert_container_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -82,8 +83,7 @@ struct ConversionTest : public ::testing::Test {}; TEST_F(ConversionTest, SameTypeFunc) { EXPECT_THAT( - std::set(ConvertContainer(std::vector{1, 2, 3}, [](int v) { return v * v; })), - ElementsAre(1, 4, 9)); + std::set(ConvertContainer(std::vector{1, 2, 3}, [](int v) { return v * v; })), ElementsAre(1, 4, 9)); } TEST_F(ConversionTest, ConversionFunc) { @@ -93,27 +93,31 @@ TEST_F(ConversionTest, ConversionFunc) { } TEST_F(ConversionTest, InitializerList) { - EXPECT_THAT( - std::set(ConvertContainer({"1", "2", "3", "4"})), - ElementsAre("1", "2", "3", "4")); + EXPECT_THAT(std::set(ConvertContainer({"1", "2", "3", "4"})), ElementsAre("1", "2", "3", "4")); } class MoveOnly final { public: ~MoveOnly() = default; MoveOnly() = delete; + explicit MoveOnly(int v) : v_(v) {} + MoveOnly(const MoveOnly&) = delete; MoveOnly& operator=(const MoveOnly&) = delete; MoveOnly(MoveOnly&&) = default; MoveOnly& operator=(MoveOnly&&) = default; - bool operator==(const MoveOnly& other) const { return v_ == other.v_; }; - bool operator<(const MoveOnly& other) const { return v_ < other.v_; }; + bool operator==(const MoveOnly& other) const { return v_ == other.v_; } + + bool operator<(const MoveOnly& other) const { return v_ < other.v_; } + bool operator==(int other) const { return Value() == other; } + bool operator<(int other) const { return Value() < other; } int Value() const { return v_; } + int MovedValue() const && { return v_; } // Used to prove an instance of `MoveOnly` was moved. private: @@ -124,16 +128,12 @@ TEST_F(ConversionTest, InitializerListMoveOnlyConversion) { // This works because we never move the `MoveOnly` std::initializer_list values{MoveOnly(1), MoveOnly(2), MoveOnly(3)}; auto conv = [](const MoveOnly& v) -> std::string { return absl::StrCat(v.Value()); }; - EXPECT_THAT( - std::set(ConvertContainer(values, conv)), - ElementsAre("1", "2", "3")); + EXPECT_THAT(std::set(ConvertContainer(values, conv)), ElementsAre("1", "2", "3")); } TEST_F(ConversionTest, MoveOnly) { auto values = MakeLimitedVector(MoveOnly(1), MoveOnly(2), MoveOnly(3)); - EXPECT_THAT( - std::set(ConvertContainer(std::move(values))), - ElementsAre(1, 2, 3)); + EXPECT_THAT(std::set(ConvertContainer(std::move(values))), ElementsAre(1, 2, 3)); EXPECT_THAT(values, IsEmpty()); } @@ -142,9 +142,7 @@ TEST_F(ConversionTest, MoveOnlyConvert) { // We even move inside the conversion func to prove we actually have an rvalue that was moved there. auto values = MakeLimitedVector(MoveOnly(1), MoveOnly(2), MoveOnly(3)); auto conv = [](MoveOnly&& v) -> std::string { return absl::StrCat(std::move(v).MovedValue()); }; - EXPECT_THAT( - std::set(ConvertContainer(std::move(values), conv)), - ElementsAre("1", "2", "3")); + EXPECT_THAT(std::set(ConvertContainer(std::move(values), conv)), ElementsAre("1", "2", "3")); EXPECT_THAT(values, IsEmpty()); } diff --git a/mbo/container/internal/limited_ordered.h b/mbo/container/internal/limited_ordered.h index 71899eb..93ce518 100644 --- a/mbo/container/internal/limited_ordered.h +++ b/mbo/container/internal/limited_ordered.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/internal/limited_ordered_config.bzl b/mbo/container/internal/limited_ordered_config.bzl index e572bc4..41f3fe0 100644 --- a/mbo/container/internal/limited_ordered_config.bzl +++ b/mbo/container/internal/limited_ordered_config.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/container/internal/limited_ordered_config.h.in b/mbo/container/internal/limited_ordered_config.h.in index 7124f93..1e83aef 100644 --- a/mbo/container/internal/limited_ordered_config.h.in +++ b/mbo/container/internal/limited_ordered_config.h.in @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_map.h b/mbo/container/limited_map.h index b7c8075..5985560 100644 --- a/mbo/container/limited_map.h +++ b/mbo/container/limited_map.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_map_test.cc b/mbo/container/limited_map_test.cc index 33d2c8a..c8c95a9 100644 --- a/mbo/container/limited_map_test.cc +++ b/mbo/container/limited_map_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_options.h b/mbo/container/limited_options.h index 36669f9..70834bb 100644 --- a/mbo/container/limited_options.h +++ b/mbo/container/limited_options.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_ordered_test.cc b/mbo/container/limited_ordered_test.cc index bd51b86..322cf06 100644 --- a/mbo/container/limited_ordered_test.cc +++ b/mbo/container/limited_ordered_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_set.h b/mbo/container/limited_set.h index b90a56b..c0e92ca 100644 --- a/mbo/container/limited_set.h +++ b/mbo/container/limited_set.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_set_benchmark.cc b/mbo/container/limited_set_benchmark.cc index 4750463..d0f45ed 100644 --- a/mbo/container/limited_set_benchmark.cc +++ b/mbo/container/limited_set_benchmark.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -110,23 +111,23 @@ class Benchmarks { if constexpr (func == Function::kContains) { if (HaveOrMiss != data->contains((*input)[item])) { state.SkipWithError("BAD_RESULT"); - break; + break; } } else if constexpr (func == Function::kFind) { if (HaveOrMiss != (data->find((*input)[item]) != data->end())) { state.SkipWithError("BAD_RESULT"); - break; + break; } } else if constexpr (func == Function::kIndexOf) { if (HaveOrMiss != (data->index_of((*input)[item]) != BenchmarkedContainer::npos)) { state.SkipWithError("BAD_RESULT"); - break; + break; } } else { state.SkipWithError("NOT IMPLEMENTED"); break; } - //state.PauseTiming(); + // state.PauseTiming(); ++item_count; if (++item >= input->size()) { item = 0; @@ -135,7 +136,7 @@ class Benchmarks { data = &test_data[test].data; input = &test_data[test].input; } - //state.ResumeTiming(); + // state.ResumeTiming(); } state.SetItemsProcessed(item_count); state.counters["Size"] = Size; diff --git a/mbo/container/limited_set_test.cc b/mbo/container/limited_set_test.cc index e28ab38..4ddf886 100644 --- a/mbo/container/limited_set_test.cc +++ b/mbo/container/limited_set_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/container/limited_vector.h b/mbo/container/limited_vector.h index d29a169..804c41e 100644 --- a/mbo/container/limited_vector.h +++ b/mbo/container/limited_vector.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,7 +31,7 @@ namespace mbo::container { #ifdef LV_REQUIRE -#undef LV_REQUIRE +# undef LV_REQUIRE #endif // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) diff --git a/mbo/container/limited_vector_test.cc b/mbo/container/limited_vector_test.cc index 86583ee..f36c2be 100644 --- a/mbo/container/limited_vector_test.cc +++ b/mbo/container/limited_vector_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/diff/BUILD.bazel b/mbo/diff/BUILD.bazel index 7555b94..222a6f1 100644 --- a/mbo/diff/BUILD.bazel +++ b/mbo/diff/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/diff/diff.bzl b/mbo/diff/diff.bzl index edecc7c..da8418b 100644 --- a/mbo/diff/diff.bzl +++ b/mbo/diff/diff.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/diff/tests/BUILD.bazel b/mbo/diff/tests/BUILD.bazel index 38ee97d..2f4ede9 100644 --- a/mbo/diff/tests/BUILD.bazel +++ b/mbo/diff/tests/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/diff/tests/diff_test_test.bzl b/mbo/diff/tests/diff_test_test.bzl index e536437..adca84c 100644 --- a/mbo/diff/tests/diff_test_test.bzl +++ b/mbo/diff/tests/diff_test_test.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/diff/unified_diff.cc b/mbo/diff/unified_diff.cc index 9ce5ba5..2c6b814 100644 --- a/mbo/diff/unified_diff.cc +++ b/mbo/diff/unified_diff.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -256,18 +257,19 @@ class Chunk { private: static std::string FileHeader(const file::Artefact& info, const UnifiedDiff::Options& options) { std::string_view name = absl::StripPrefix(info.name, options.strip_file_header_prefix); - return absl::StrCat( - info.name.empty() ? "-" : name, " ", absl::FormatTime(options.time_format, info.time, info.tz)); + return absl::StrCat(info.name.empty() ? "-" : name, " ", absl::FormatTime(options.time_format, info.time, info.tz)); } - static std::string SelectFileHeader(const file::Artefact& either, const file::Artefact& lhs, const file::Artefact& rhs, const UnifiedDiff::Options& options) { + static std::string SelectFileHeader( + const file::Artefact& either, + const file::Artefact& lhs, + const file::Artefact& rhs, + const UnifiedDiff::Options& options) { switch (options.file_header_use) { case UnifiedDiff::Options::FileHeaderUse::kBoth: break; // Do not use default, but break for this case, so it becomes the function return. - case UnifiedDiff::Options::FileHeaderUse::kLeft: - return FileHeader(lhs, options); - case UnifiedDiff::Options::FileHeaderUse::kRight: - return FileHeader(rhs, options); + case UnifiedDiff::Options::FileHeaderUse::kLeft: return FileHeader(lhs, options); + case UnifiedDiff::Options::FileHeaderUse::kRight: return FileHeader(rhs, options); } return FileHeader(either, options); } @@ -311,7 +313,7 @@ class Chunk { } void OutputChunk() { - absl::Cleanup clear = [this]{ Clear(); }; + absl::Cleanup clear = [this] { Clear(); }; if (lhs_size_ == 0 && rhs_size_ == 0) { return; } diff --git a/mbo/diff/unified_diff.h b/mbo/diff/unified_diff.h index 6f9dadd..c898232 100644 --- a/mbo/diff/unified_diff.h +++ b/mbo/diff/unified_diff.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/diff/unified_diff_main.cc b/mbo/diff/unified_diff_main.cc index 6dde560..d3514ee 100755 --- a/mbo/diff/unified_diff_main.cc +++ b/mbo/diff/unified_diff_main.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/diff/unified_diff_test.cc b/mbo/diff/unified_diff_test.cc index 0b91867..3b081b7 100644 --- a/mbo/diff/unified_diff_test.cc +++ b/mbo/diff/unified_diff_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/diff/update_absl_log_flags.cc b/mbo/diff/update_absl_log_flags.cc index 3b3f644..2abc344 100644 --- a/mbo/diff/update_absl_log_flags.cc +++ b/mbo/diff/update_absl_log_flags.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/diff/update_absl_log_flags.h b/mbo/diff/update_absl_log_flags.h index e303621..65da1f3 100644 --- a/mbo/diff/update_absl_log_flags.h +++ b/mbo/diff/update_absl_log_flags.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/file/BUILD.bazel b/mbo/file/BUILD.bazel index 1048195..be3f3fb 100644 --- a/mbo/file/BUILD.bazel +++ b/mbo/file/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/file/artefact.cc b/mbo/file/artefact.cc index 3f8bde5..7892ea8 100644 --- a/mbo/file/artefact.cc +++ b/mbo/file/artefact.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -45,7 +46,10 @@ absl::StatusOr Artefact::Read(std::string_view filename, const Artefac }; } -absl::StatusOr Artefact::ReadMaxLines(std::string_view filename, std::size_t max_lines, const Artefact::Options& options) { +absl::StatusOr Artefact::ReadMaxLines( + std::string_view filename, + std::size_t max_lines, + const Artefact::Options& options) { const auto data = mbo::file::GetMaxLines(filename, max_lines); if (!data.ok()) { return data.status(); diff --git a/mbo/file/artefact.h b/mbo/file/artefact.h index d9ea7db..9a54d35 100644 --- a/mbo/file/artefact.h +++ b/mbo/file/artefact.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/file/file.cc b/mbo/file/file.cc index 6d97985..4f2ebf4 100644 --- a/mbo/file/file.cc +++ b/mbo/file/file.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -121,7 +122,7 @@ absl::StatusOr GetMaxLines(const std::filesystem::path& file_name, if (ifs.eof()) { return result; } - + while (curr_line++ < max_lines) { line.clear(); std::getline(ifs, line, '\n'); diff --git a/mbo/file/file.h b/mbo/file/file.h index 3653104..48898ff 100644 --- a/mbo/file/file.h +++ b/mbo/file/file.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/file/file_test.cc b/mbo/file/file_test.cc index 70e7032..f7164ed 100644 --- a/mbo/file/file_test.cc +++ b/mbo/file/file_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,8 +34,7 @@ using ::testing::HasSubstr; struct FileTest : public ::testing::Test { static std::string TestDir() { - const auto* const test = - ::testing::UnitTest::GetInstance()->current_test_info(); + const auto* const test = ::testing::UnitTest::GetInstance()->current_test_info(); return JoinPaths(::testing::TempDir(), test->name()); } @@ -60,9 +60,8 @@ TEST_F(FileTest, SetGetContentsWithZero) { TEST_F(FileTest, Readable) { EXPECT_THAT( - Readable(tmp_dir), StatusIs( - absl::StatusCode::kFailedPrecondition, - HasSubstr("Cannot open directory for reading"))); + Readable(tmp_dir), + StatusIs(absl::StatusCode::kFailedPrecondition, HasSubstr("Cannot open directory for reading"))); const fs::path tmp_file = JoinPaths(tmp_dir, "foo.txt"); ASSERT_OK(SetContents(tmp_file, "foo")); EXPECT_OK(Readable(tmp_file.string())); @@ -158,7 +157,6 @@ TEST_F(FileTest, JoinPaths) { #endif } - TEST_F(FileTest, JoinPathsRespectAbsolute) { EXPECT_THAT(JoinPathsRespectAbsolute(""), ""); EXPECT_THAT(JoinPathsRespectAbsolute("a"), "a"); diff --git a/mbo/file/ini/BUILD.bazel b/mbo/file/ini/BUILD.bazel index 8ab8f5d..3162e60 100644 --- a/mbo/file/ini/BUILD.bazel +++ b/mbo/file/ini/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -42,4 +43,4 @@ cc_test( "//mbo/testing:status_cc", "@com_google_googletest//:gtest_main", ], -) \ No newline at end of file +) diff --git a/mbo/file/ini/ini_file.cc b/mbo/file/ini/ini_file.cc index a0a50f3..ceed268 100644 --- a/mbo/file/ini/ini_file.cc +++ b/mbo/file/ini/ini_file.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -64,7 +65,6 @@ absl::StatusOr IniFile::GetKeyOrStatus(const GroupKey& group_key) c const auto value_it = group_it->second.find(key); if (value_it == group_it->second.end()) { return absl::NotFoundError(absl::StrCat("Group [", group, "] has no key '", key, "'.")); - } return value_it->second; } diff --git a/mbo/file/ini/ini_file.h b/mbo/file/ini/ini_file.h index 8e2e5c0..80902b3 100644 --- a/mbo/file/ini/ini_file.h +++ b/mbo/file/ini/ini_file.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/file/ini/ini_file_test.cc b/mbo/file/ini/ini_file_test.cc index 069b1bd..bcf8111 100644 --- a/mbo/file/ini/ini_file_test.cc +++ b/mbo/file/ini/ini_file_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/mope/BUILD.bazel b/mbo/mope/BUILD.bazel index 5bd0f56..2b1c1b7 100644 --- a/mbo/mope/BUILD.bazel +++ b/mbo/mope/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/mope/ini.cc b/mbo/mope/ini.cc index 1c6dbf5..8a223c1 100644 --- a/mbo/mope/ini.cc +++ b/mbo/mope/ini.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/mope/ini.h b/mbo/mope/ini.h index d6926ad..f7a7857 100644 --- a/mbo/mope/ini.h +++ b/mbo/mope/ini.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/mope/mope.bzl b/mbo/mope/mope.bzl index e0c32e7..22d2e97 100644 --- a/mbo/mope/mope.bzl +++ b/mbo/mope/mope.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/mope/mope.cc b/mbo/mope/mope.cc index f66d243..061086b 100644 --- a/mbo/mope/mope.cc +++ b/mbo/mope/mope.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/mope/mope.h b/mbo/mope/mope.h index a424a80..b27aa67 100644 --- a/mbo/mope/mope.h +++ b/mbo/mope/mope.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// xSPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/mope/mope_main.cc b/mbo/mope/mope_main.cc index 895ba95..6d67206 100644 --- a/mbo/mope/mope_main.cc +++ b/mbo/mope/mope_main.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/status/BUILD.bazel b/mbo/status/BUILD.bazel index 06d94fe..651932e 100644 --- a/mbo/status/BUILD.bazel +++ b/mbo/status/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -22,4 +23,4 @@ cc_library( "@com_google_absl//absl/status:statusor", ], visibility = ["//visibility:public"], -) \ No newline at end of file +) diff --git a/mbo/status/status_macros.h b/mbo/status/status_macros.h index 4a4d7f9..444d3a1 100644 --- a/mbo/status/status_macros.h +++ b/mbo/status/status_macros.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/BUILD.bazel b/mbo/strings/BUILD.bazel index 45a5e74..4e58ace 100644 --- a/mbo/strings/BUILD.bazel +++ b/mbo/strings/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -85,4 +86,4 @@ cc_test( "@com_google_absl//absl/status:statusor", "@com_google_googletest//:gtest_main", ], -) \ No newline at end of file +) diff --git a/mbo/strings/indent.cc b/mbo/strings/indent.cc index befd446..f7a50b6 100644 --- a/mbo/strings/indent.cc +++ b/mbo/strings/indent.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/indent.h b/mbo/strings/indent.h index dbb2c14..536fb69 100644 --- a/mbo/strings/indent.h +++ b/mbo/strings/indent.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/indent_test.cc b/mbo/strings/indent_test.cc index 3b6a69d..d7ae3d8 100644 --- a/mbo/strings/indent_test.cc +++ b/mbo/strings/indent_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -24,7 +25,9 @@ using ::testing::ElementsAre; class DropIndentTest : public ::testing::Test {}; -TEST_F(DropIndentTest, Empty) { EXPECT_THAT(DropIndent(""), ""); } +TEST_F(DropIndentTest, Empty) { + EXPECT_THAT(DropIndent(""), ""); +} TEST_F(DropIndentTest, Single) { EXPECT_THAT(DropIndent("abc"), "abc"); @@ -41,8 +44,7 @@ TEST_F(DropIndentTest, EmptyLines) { EXPECT_THAT(DropIndentAndSplit("\n \n "), ElementsAre("", "")); EXPECT_THAT(DropIndentAndSplit("\n \n 1\n "), ElementsAre("", "1", "")); EXPECT_THAT(DropIndentAndSplit("\n \n 2\n "), ElementsAre("", " 2", "")); - EXPECT_THAT( - DropIndentAndSplit("\n 1\n\n 1\n "), ElementsAre("1", "", "1", "")); + EXPECT_THAT(DropIndentAndSplit("\n 1\n\n 1\n "), ElementsAre("1", "", "1", "")); } TEST_F(DropIndentTest, Basic) { @@ -54,13 +56,9 @@ TEST_F(DropIndentTest, Basic) { } TEST_F(DropIndentTest, NonEmptyFirst) { - EXPECT_THAT(DropIndentAndSplit("a\n"), ElementsAre("a", "")) - << "Keep first line content."; - EXPECT_THAT(DropIndentAndSplit(" a\n 1"), ElementsAre(" a", "1")) - << "Keep first line content."; - EXPECT_THAT( - DropIndentAndSplit("a\n 1\n 2\n 1\n"), - ElementsAre("a", "1", " 2", "1", "")) + EXPECT_THAT(DropIndentAndSplit("a\n"), ElementsAre("a", "")) << "Keep first line content."; + EXPECT_THAT(DropIndentAndSplit(" a\n 1"), ElementsAre(" a", "1")) << "Keep first line content."; + EXPECT_THAT(DropIndentAndSplit("a\n 1\n 2\n 1\n"), ElementsAre("a", "1", " 2", "1", "")) << "Keep first line content."; } diff --git a/mbo/strings/parse.cc b/mbo/strings/parse.cc index abb5a91..6675c6f 100644 --- a/mbo/strings/parse.cc +++ b/mbo/strings/parse.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -127,7 +128,7 @@ void HandleQuotes(const ParseOptions& options, char chr, Quotes& quotes, std::st namespace { bool StopParsing(const ParseOptions& options, std::string_view data) { const char chr = data[0]; - return absl::StrContains(options.stop_at_any_of, chr) // + return absl::StrContains(options.stop_at_any_of, chr) // || absl::StrContains(options.split_at_any_of, chr) || (!options.stop_at_str.empty() && data.starts_with(options.stop_at_str)); } diff --git a/mbo/strings/parse.h b/mbo/strings/parse.h index a280f75..dbbf085 100644 --- a/mbo/strings/parse.h +++ b/mbo/strings/parse.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/parse_test.cc b/mbo/strings/parse_test.cc index b6a5c01..bcae553 100644 --- a/mbo/strings/parse_test.cc +++ b/mbo/strings/parse_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -180,8 +181,9 @@ TEST_F(ParseTest, ParseStringErrors) { ParseString({}, "\\U"), StatusIs(absl::StatusCode::kUnimplemented, "ParseString input has not yet supported unicode escape sequence.")); EXPECT_THAT( - ParseString({}, "\\N"), - StatusIs(absl::StatusCode::kUnimplemented, "ParseString input has not yet supported named unicode char escape sequence.")); + ParseString({}, "\\N"), StatusIs( + absl::StatusCode::kUnimplemented, + "ParseString input has not yet supported named unicode char escape sequence.")); } TEST_F(ParseTest, ParseStringList) { diff --git a/mbo/strings/strip.cc b/mbo/strings/strip.cc index 4420715..ab8911d 100644 --- a/mbo/strings/strip.cc +++ b/mbo/strings/strip.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/strip.h b/mbo/strings/strip.h index c0e9074..7cc2ac1 100644 --- a/mbo/strings/strip.h +++ b/mbo/strings/strip.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/strings/strip_test.cc b/mbo/strings/strip_test.cc index 50fac10..84c325b 100644 --- a/mbo/strings/strip_test.cc +++ b/mbo/strings/strip_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/testing/BUILD.bazel b/mbo/testing/BUILD.bazel index 848a4c9..8892a21 100644 --- a/mbo/testing/BUILD.bazel +++ b/mbo/testing/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/testing/matchers.h b/mbo/testing/matchers.h index cb28b99..a074db0 100644 --- a/mbo/testing/matchers.h +++ b/mbo/testing/matchers.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/testing/runfiles_dir.cc b/mbo/testing/runfiles_dir.cc index de43111..fc66353 100644 --- a/mbo/testing/runfiles_dir.cc +++ b/mbo/testing/runfiles_dir.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,17 +18,18 @@ #include #include -#include "tools/cpp/runfiles/runfiles.h" #include "absl/log/absl_check.h" #include "absl/status/status.h" #include "absl/status/statusor.h" #include "mbo/file/file.h" +#include "tools/cpp/runfiles/runfiles.h" namespace mbo::testing { absl::StatusOr RunfilesDir(std::string_view workspace, std::string_view source_rel) { std::string error; - std::unique_ptr runfiles(bazel::tools::cpp::runfiles::Runfiles::CreateForTest(&error)); + std::unique_ptr runfiles( + bazel::tools::cpp::runfiles::Runfiles::CreateForTest(&error)); if (runfiles == nullptr) { return absl::NotFoundError("Could not determine runfiles directory."); } diff --git a/mbo/testing/runfiles_dir.h b/mbo/testing/runfiles_dir.h index 03a430d..44ff4fb 100644 --- a/mbo/testing/runfiles_dir.h +++ b/mbo/testing/runfiles_dir.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/testing/status.h b/mbo/testing/status.h index d2670d5..e676b82 100644 --- a/mbo/testing/status.h +++ b/mbo/testing/status.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/testing/status_test.cc b/mbo/testing/status_test.cc index e1f09b7..1fda536 100644 --- a/mbo/testing/status_test.cc +++ b/mbo/testing/status_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -57,9 +58,7 @@ class StatusMatcherTest : public ::testing::Test { } template - static std::pair MatchAndExplain( - const Matcher& matcher, - const V& value) { + static std::pair MatchAndExplain(const Matcher& matcher, const V& value) { ::testing::StringMatchResultListener os; const bool result = matcher.MatchAndExplain(value, &os); return {result, os.str()}; @@ -82,8 +81,7 @@ TEST_F(StatusMatcherTest, IsOk) { EXPECT_THAT(DescribeNegation(matcher), "is not OK"); EXPECT_THAT(MatchAndExplain(matcher, absl::OkStatus()), Pair(true, "")); EXPECT_THAT( - MatchAndExplain(matcher, absl::UnknownError("Message")), - Pair(false, "which has status UNKNOWN: 'Message'")); + MatchAndExplain(matcher, absl::UnknownError("Message")), Pair(false, "which has status UNKNOWN: 'Message'")); } { const ::testing::Matcher> matcher = IsOkMatcher(); @@ -91,8 +89,7 @@ TEST_F(StatusMatcherTest, IsOk) { EXPECT_THAT(DescribeNegation(matcher), "is not OK"); EXPECT_THAT(MatchAndExplain(matcher, 42), Pair(true, "")); EXPECT_THAT( - MatchAndExplain(matcher, absl::UnknownError("Message")), - Pair(false, "which has status UNKNOWN: 'Message'")); + MatchAndExplain(matcher, absl::UnknownError("Message")), Pair(false, "which has status UNKNOWN: 'Message'")); } } @@ -100,15 +97,9 @@ TEST_F(StatusMatcherTest, StatusIs) { EXPECT_THAT(absl::OkStatus(), StatusIs(absl::StatusCode::kOk)); EXPECT_THAT(absl::OkStatus(), StatusIs(absl::StatusCode::kOk, "")); EXPECT_THAT(absl::AbortedError(""), StatusIs(absl::StatusCode::kAborted)); - EXPECT_THAT( - absl::AbortedError("a-sub-c"), - StatusIs(absl::StatusCode::kAborted, "a-sub-c")); - EXPECT_THAT( - absl::AbortedError("a-sub-c"), - StatusIs(absl::StatusCode::kAborted, HasSubstr("-sub-"))); - EXPECT_THAT( - absl::AbortedError("a-sub-c"), - StatusIs(absl::StatusCode::kAborted, Not(HasSubstr("not-a-substring")))); + EXPECT_THAT(absl::AbortedError("a-sub-c"), StatusIs(absl::StatusCode::kAborted, "a-sub-c")); + EXPECT_THAT(absl::AbortedError("a-sub-c"), StatusIs(absl::StatusCode::kAborted, HasSubstr("-sub-"))); + EXPECT_THAT(absl::AbortedError("a-sub-c"), StatusIs(absl::StatusCode::kAborted, Not(HasSubstr("not-a-substring")))); absl::StatusOr test; EXPECT_THAT(test, Not(StatusIs(absl::StatusCode::kOk))); test = 42; @@ -119,17 +110,13 @@ TEST_F(StatusMatcherTest, StatusIs) { { const StatusIsMatcher matcher(absl::StatusCode::kOk, "x"); EXPECT_THAT(Describe(matcher), "OK and the message is equal to \"x\""); - EXPECT_THAT( - DescribeNegation(matcher), - "not (OK and the message is equal to \"x\")"); - EXPECT_THAT(MatchAndExplain(matcher, absl::OkStatus()), Pair(true, "")) - << "Must ignore status message if Ok"; + EXPECT_THAT(DescribeNegation(matcher), "not (OK and the message is equal to \"x\")"); + EXPECT_THAT(MatchAndExplain(matcher, absl::OkStatus()), Pair(true, "")) << "Must ignore status message if Ok"; } { const StatusIsMatcher matcher(absl::StatusCode::kOk, ""); EXPECT_THAT(Describe(matcher), "OK and the message is equal to \"\""); - EXPECT_THAT( - DescribeNegation(matcher), "not (OK and the message is equal to \"\")"); + EXPECT_THAT(DescribeNegation(matcher), "not (OK and the message is equal to \"\")"); EXPECT_THAT( MatchAndExplain(matcher, absl::UnknownError("")), Pair( @@ -145,20 +132,14 @@ TEST_F(StatusMatcherTest, StatusIs) { } { const StatusIsMatcher matcher(absl::StatusCode::kCancelled, "Wanted"); + EXPECT_THAT(Describe(matcher), "CANCELLED and the message is equal to \"Wanted\""); + EXPECT_THAT(DescribeNegation(matcher), "not (CANCELLED and the message is equal to \"Wanted\")"); + EXPECT_THAT(MatchAndExplain(matcher, absl::OkStatus()), Pair(false, "which has status OK that isn't CANCELLED")); EXPECT_THAT( - Describe(matcher), "CANCELLED and the message is equal to \"Wanted\""); - EXPECT_THAT( - DescribeNegation(matcher), - "not (CANCELLED and the message is equal to \"Wanted\")"); - EXPECT_THAT( - MatchAndExplain(matcher, absl::OkStatus()), - Pair(false, "which has status OK that isn't CANCELLED")); - EXPECT_THAT( - MatchAndExplain(matcher, absl::AbortedError("Wanted")), - Pair( - false, - "which has status ABORTED that isn't CANCELLED " - "and has a matching message")); + MatchAndExplain(matcher, absl::AbortedError("Wanted")), Pair( + false, + "which has status ABORTED that isn't CANCELLED " + "and has a matching message")); EXPECT_THAT( MatchAndExplain(matcher, absl::CancelledError("Message")), Pair( @@ -169,8 +150,7 @@ TEST_F(StatusMatcherTest, StatusIs) { { const StatusIsMatcher matcher(absl::StatusCode::kDataLoss, IsEmpty()); EXPECT_THAT(Describe(matcher), "DATA_LOSS and the message is empty"); - EXPECT_THAT( - DescribeNegation(matcher), "not (DATA_LOSS and the message is empty)"); + EXPECT_THAT(DescribeNegation(matcher), "not (DATA_LOSS and the message is empty)"); EXPECT_THAT( MatchAndExplain(matcher, absl::DataLossError("Message")), Pair( @@ -191,39 +171,23 @@ TEST_F(StatusMatcherTest, IsOkAndHolds) { EXPECT_THAT(test, Not(IsOkAndHolds(_))); } { - const ::testing::Matcher> matcher = - IsOkAndHoldsMatcher(42); + const ::testing::Matcher> matcher = IsOkAndHoldsMatcher(42); EXPECT_THAT(Describe(matcher), "is OK and has a value that is equal to 42"); - EXPECT_THAT( - DescribeNegation(matcher), - "isn't OK or has a value that isn't equal to 42"); - EXPECT_THAT( - MatchAndExplain(matcher, absl::StatusOr{42}), Pair(true, "")); - EXPECT_THAT( - MatchAndExplain(matcher, absl::StatusOr{25}), - Pair(false, "which contains value 25")); - EXPECT_THAT( - MatchAndExplain(matcher, absl::UnknownError("")), - Pair(false, "which has status UNKNOWN")); + EXPECT_THAT(DescribeNegation(matcher), "isn't OK or has a value that isn't equal to 42"); + EXPECT_THAT(MatchAndExplain(matcher, absl::StatusOr{42}), Pair(true, "")); + EXPECT_THAT(MatchAndExplain(matcher, absl::StatusOr{25}), Pair(false, "which contains value 25")); + EXPECT_THAT(MatchAndExplain(matcher, absl::UnknownError("")), Pair(false, "which has status UNKNOWN")); } { - const ::testing::Matcher> matcher = - IsOkAndHolds(Ge(42)); + const ::testing::Matcher> matcher = IsOkAndHolds(Ge(42)); EXPECT_THAT(Describe(matcher), "is OK and has a value that is >= 42"); - EXPECT_THAT( - DescribeNegation(matcher), "isn't OK or has a value that isn't >= 42"); - EXPECT_THAT( - MatchAndExplain(matcher, absl::StatusOr{42}), Pair(true, "")); - EXPECT_THAT( - MatchAndExplain(matcher, absl::StatusOr{25}), - Pair(false, "which contains value 25")); - EXPECT_THAT( - MatchAndExplain(matcher, absl::UnknownError("")), - Pair(false, "which has status UNKNOWN")); + EXPECT_THAT(DescribeNegation(matcher), "isn't OK or has a value that isn't >= 42"); + EXPECT_THAT(MatchAndExplain(matcher, absl::StatusOr{42}), Pair(true, "")); + EXPECT_THAT(MatchAndExplain(matcher, absl::StatusOr{25}), Pair(false, "which contains value 25")); + EXPECT_THAT(MatchAndExplain(matcher, absl::UnknownError("")), Pair(false, "which has status UNKNOWN")); } { - const ::testing::Matcher> matcher = - IsOkAndHolds(IsEmpty()); + const ::testing::Matcher> matcher = IsOkAndHolds(IsEmpty()); EXPECT_THAT( MatchAndExplain(matcher, absl::StatusOr{"25"}), Pair(false, "which contains value \"25\", whose size is 2")); diff --git a/mbo/types/BUILD.bazel b/mbo/types/BUILD.bazel index affd8cc..e65f52a 100644 --- a/mbo/types/BUILD.bazel +++ b/mbo/types/BUILD.bazel @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/mbo/types/cases.h b/mbo/types/cases.h index 8c4843e..da92b04 100644 --- a/mbo/types/cases.h +++ b/mbo/types/cases.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/cases_test.cc b/mbo/types/cases_test.cc index 082cb1a..d17b0ce 100644 --- a/mbo/types/cases_test.cc +++ b/mbo/types/cases_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/compare.h b/mbo/types/compare.h index 7c08495..12ca0d2 100644 --- a/mbo/types/compare.h +++ b/mbo/types/compare.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/extend.h b/mbo/types/extend.h index 9946db1..93478e2 100644 --- a/mbo/types/extend.h +++ b/mbo/types/extend.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/extend_test.cc b/mbo/types/extend_test.cc index 667f428..c12afa6 100644 --- a/mbo/types/extend_test.cc +++ b/mbo/types/extend_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/extender.h b/mbo/types/extender.h index dc399df..6958457 100644 --- a/mbo/types/extender.h +++ b/mbo/types/extender.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/BUILD.bazel b/mbo/types/internal/BUILD.bazel index e2b8a1f..14bda4d 100644 --- a/mbo/types/internal/BUILD.bazel +++ b/mbo/types/internal/BUILD.bazel @@ -1,4 +1,4 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -64,4 +64,4 @@ mope_test( srcs = ["decompose_count.h.mope"], outs = ["decompose_count.h"], clang_format = True, -) \ No newline at end of file +) diff --git a/mbo/types/internal/binary_search.h b/mbo/types/internal/binary_search.h index 621a9c1..fda5b68 100644 --- a/mbo/types/internal/binary_search.h +++ b/mbo/types/internal/binary_search.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/cases.h b/mbo/types/internal/cases.h index 733769e..7002505 100644 --- a/mbo/types/internal/cases.h +++ b/mbo/types/internal/cases.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/decompose_count.h b/mbo/types/internal/decompose_count.h index 54914b1..7c0cbd1 100644 --- a/mbo/types/internal/decompose_count.h +++ b/mbo/types/internal/decompose_count.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/decompose_count.h.mope b/mbo/types/internal/decompose_count.h.mope index 80f1a53..0826aa8 100644 --- a/mbo/types/internal/decompose_count.h.mope +++ b/mbo/types/internal/decompose_count.h.mope @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/extend.h b/mbo/types/internal/extend.h index ca2bc55..881606f 100644 --- a/mbo/types/internal/extend.h +++ b/mbo/types/internal/extend.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/extender.h b/mbo/types/internal/extender.h index de5de50..a43b980 100644 --- a/mbo/types/internal/extender.h +++ b/mbo/types/internal/extender.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/internal/is_braces_constructible.h b/mbo/types/internal/is_braces_constructible.h index 5168213..1d8f0f2 100644 --- a/mbo/types/internal/is_braces_constructible.h +++ b/mbo/types/internal/is_braces_constructible.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -22,8 +23,8 @@ namespace mbo::types::types_internal { #ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wmissing-braces" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wmissing-braces" #endif struct AnyType { @@ -119,7 +120,7 @@ template using IsBracesConstructibleImplT = typename IsBracesConstructibleImpl::type; #ifdef __clang__ -#pragma clang diagnostic pop +# pragma clang diagnostic pop #endif } // namespace mbo::types::types_internal diff --git a/mbo/types/internal/struct_names.h b/mbo/types/internal/struct_names.h index 3c83aee..a37d4d4 100644 --- a/mbo/types/internal/struct_names.h +++ b/mbo/types/internal/struct_names.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,7 +22,7 @@ #if defined(__clang__) && __has_builtin(__builtin_dump_struct) -#include "mbo/types/internal/struct_names_clang.h" // IWYU pragma: keep +# include "mbo/types/internal/struct_names_clang.h" // IWYU pragma: keep namespace mbo::types::types_internal { diff --git a/mbo/types/internal/struct_names_clang.h b/mbo/types/internal/struct_names_clang.h index b40bda9..71dfee3 100644 --- a/mbo/types/internal/struct_names_clang.h +++ b/mbo/types/internal/struct_names_clang.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,11 +17,11 @@ #define MBO_TYPES_INTERNAL_STRUCT_NAMES_CLANG_H_ #if defined(__clang__) && __has_builtin(__builtin_dump_struct) -#include -#include +# include +# include -#include "absl/types/span.h" -#include "mbo/types/internal/decompose_count.h" // IWYU pragma: keep +# include "absl/types/span.h" +# include "mbo/types/internal/decompose_count.h" // IWYU pragma: keep // IWYU pragma: private, include "mbo/types/internal/struct_names.h" diff --git a/mbo/types/internal/test_types.h b/mbo/types/internal/test_types.h index 5e0a8b9..db1d617 100644 --- a/mbo/types/internal/test_types.h +++ b/mbo/types/internal/test_types.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/no_destruct.h b/mbo/types/no_destruct.h index df0e11b..782b78d 100644 --- a/mbo/types/no_destruct.h +++ b/mbo/types/no_destruct.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/no_destruct_test.cc b/mbo/types/no_destruct_test.cc index 217c154..b8e441e 100644 --- a/mbo/types/no_destruct_test.cc +++ b/mbo/types/no_destruct_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,13 +35,13 @@ static constexpr int kValueA = 25; static constexpr int kValueB = 42; struct TestSimple : Extend { - int a = kValueA; - int b = kValueB; + int a = kValueA; + int b = kValueB; }; struct TestString : Extend { - std::string a = "25"; - std::string b = "42"; + std::string a = "25"; + std::string b = "42"; }; static_assert(IsAggregate, "Must be aggregate"); @@ -58,54 +59,52 @@ class NoDestructTest : public ::testing::Test {}; #ifdef _LIBCPP_STD_VER TEST_F(NoDestructTest, ClangCheck) { - const std::string k_lib_cpp_std_ver = std::to_string(_LIBCPP_STD_VER); - EXPECT_THAT(k_lib_cpp_std_ver, Ge("20")); + const std::string k_lib_cpp_std_ver = std::to_string(_LIBCPP_STD_VER); + EXPECT_THAT(k_lib_cpp_std_ver, Ge("20")); } #endif // _LIBCPP_STD_VER TEST_F(NoDestructTest, Test) { - const auto expected_simple = Conditional(kStructNameSupport, "{.a: 25, .b: 42}", "{25, 42}"); - const auto expected_string = Conditional(kStructNameSupport, R"({.a: "25", .b: "42"})", R"({"25", "42"})"); - EXPECT_THAT(kTestSimple.Get().ToString(), expected_simple); - EXPECT_THAT((*kTestSimple).ToString(), expected_simple); - EXPECT_THAT(kTestSimple->ToString(), expected_simple); - EXPECT_THAT(kTestString.Get().ToString(), expected_string); - EXPECT_THAT((*kTestString).ToString(), expected_string); - EXPECT_THAT(kTestString->ToString(), expected_string); + const auto expected_simple = Conditional(kStructNameSupport, "{.a: 25, .b: 42}", "{25, 42}"); + const auto expected_string = Conditional(kStructNameSupport, R"({.a: "25", .b: "42"})", R"({"25", "42"})"); + EXPECT_THAT(kTestSimple.Get().ToString(), expected_simple); + EXPECT_THAT((*kTestSimple).ToString(), expected_simple); + EXPECT_THAT(kTestSimple->ToString(), expected_simple); + EXPECT_THAT(kTestString.Get().ToString(), expected_string); + EXPECT_THAT((*kTestString).ToString(), expected_string); + EXPECT_THAT(kTestString->ToString(), expected_string); } static constexpr NoDestruct kConstexprTest; // NOLINT(readability-static-definition-in-anonymous-namespace) TEST_F(NoDestructTest, ConstExpr) { - EXPECT_THAT(kConstexprTest->a, kValueA); - EXPECT_THAT(kConstexprTest->b, kValueB); + EXPECT_THAT(kConstexprTest->a, kValueA); + EXPECT_THAT(kConstexprTest->b, kValueB); } TEST_F(NoDestructTest, Modify) { - static NoDestruct test; - EXPECT_THAT(test->a, kValueA); - EXPECT_THAT(test->b, kValueB); - test->a = 3; - ASSERT_THAT(kValueA, Ne(3)); - EXPECT_THAT(test->a, Ne(kValueA)); - EXPECT_THAT(test->b, kValueB); - test->a = kValueA; - EXPECT_THAT(test->a, kValueA); - EXPECT_THAT(test->b, kValueB); + static NoDestruct test; + EXPECT_THAT(test->a, kValueA); + EXPECT_THAT(test->b, kValueB); + test->a = 3; + ASSERT_THAT(kValueA, Ne(3)); + EXPECT_THAT(test->a, Ne(kValueA)); + EXPECT_THAT(test->b, kValueB); + test->a = kValueA; + EXPECT_THAT(test->a, kValueA); + EXPECT_THAT(test->b, kValueB); } TEST_F(NoDestructTest, NoDtorNoCopyNoMove) { struct NoDtor { NoDtor() = default; - ~NoDtor() { - ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; - } - NoDtor(const NoDtor& other) : a(other.a){ - ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; - } - NoDtor(NoDtor&& other) noexcept : a(other.a){ - ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; - } + + ~NoDtor() { ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; } + + NoDtor(const NoDtor& other) : a(other.a) { ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; } + + NoDtor(NoDtor&& other) noexcept : a(other.a) { ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; } + NoDtor& operator=(const NoDtor& other) noexcept { ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; if (this != &other) { @@ -113,14 +112,16 @@ TEST_F(NoDestructTest, NoDtorNoCopyNoMove) { } return *this; } + NoDtor& operator=(NoDtor&& other) noexcept { ABSL_CHECK(true) << "Should not call: " << __FUNCTION__; a = other.a; return *this; } - + int a = kValueA; }; + NoDestruct test; EXPECT_THAT(test->a, kValueA); test->a = kValueB; diff --git a/mbo/types/ref_wrap.h b/mbo/types/ref_wrap.h index b1ede7c..332dbeb 100644 --- a/mbo/types/ref_wrap.h +++ b/mbo/types/ref_wrap.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/ref_wrap_test.cc b/mbo/types/ref_wrap_test.cc index c141212..8f35108 100644 --- a/mbo/types/ref_wrap_test.cc +++ b/mbo/types/ref_wrap_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/traits.h b/mbo/types/traits.h index c47eada..e61f238 100644 --- a/mbo/types/traits.h +++ b/mbo/types/traits.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/traits_test.cc b/mbo/types/traits_test.cc index cd1b023..8f7775e 100644 --- a/mbo/types/traits_test.cc +++ b/mbo/types/traits_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,22 +26,22 @@ namespace { using ::mbo::types::types_internal::AnyBaseType; using ::mbo::types::types_internal::AnyType; -using ::testing::Ne; using std::size_t; +using ::testing::Ne; // NOLINTNEXTLINE(google-build-using-namespace) using namespace ::mbo::types::types_internal::test_types; class TraitsTest : public ::testing::Test {}; -template T> +template T> constexpr bool Tester() noexcept { - return 1; + return 1; } -template T> +template T> constexpr bool Tester() noexcept { - return 0; + return 0; } TEST_F(TraitsTest, Concepts) { @@ -56,10 +57,8 @@ TEST_F(TraitsTest, Concepts) { template struct GenTraitsTest : public ::testing::Test { - static constexpr size_t kDerivedFieldCount = - static_cast(TestType::kFieldCount); - static constexpr size_t kBaseFieldCount = - static_cast(TestType::BaseType::kFieldCount); + static constexpr size_t kDerivedFieldCount = static_cast(TestType::kFieldCount); + static constexpr size_t kBaseFieldCount = static_cast(TestType::BaseType::kFieldCount); }; TYPED_TEST_SUITE(GenTraitsTest, AllConstructedTypes); @@ -130,9 +129,9 @@ TEST_F(TraitsTest, DecomposeCountV) { } struct MadMix { - int a = 0; - std::string b; - char c[5] {}; // NOLINT(*-magic-numbers,*-avoid-c-arrays) + int a = 0; + std::string b; + char c[5]{}; // NOLINT(*-magic-numbers,*-avoid-c-arrays) }; TEST_F(TraitsTest, DecomposeMadMix) { @@ -145,9 +144,7 @@ TYPED_TEST(GenTraitsTest, DecomposeCountV) { using Type = TypeParam; constexpr size_t kBase = TestFixture::kBaseFieldCount; constexpr size_t kDerived = TestFixture::kDerivedFieldCount; - EXPECT_THAT( - DecomposeCountV, - kBase && kDerived ? NotDecomposableV : kBase + kDerived); + EXPECT_THAT(DecomposeCountV, kBase && kDerived ? NotDecomposableV : kBase + kDerived); } TEST_F(TraitsTest, IsBracesContructible) { @@ -168,13 +165,11 @@ TEST_F(TraitsTest, IsBracesContructible) { EXPECT_THAT((IsBracesConstructibleV), true); EXPECT_THAT((IsBracesConstructibleV), true); EXPECT_THAT((IsBracesConstructibleV), false); - EXPECT_THAT( - (IsBracesConstructibleV), false); + EXPECT_THAT((IsBracesConstructibleV), false); } TEST_F(TraitsTest, IsBracesContructibleDerived) { - static_assert( - std::is_base_of_v>, "Bad type generation"); + static_assert(std::is_base_of_v>, "Bad type generation"); EXPECT_THAT((IsBracesConstructibleV, Empty>), true); } @@ -197,98 +192,38 @@ TYPED_TEST(GenTraitsTest, IsBracesContructibleGenerateDerived) { EXPECT_THAT((IsBracesConstructibleV), true); EXPECT_THAT((IsBracesConstructibleV>), true); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 0 && kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 1 && kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 2 && kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 3 && kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV), kBase == 0 && kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV), kBase == 1 && kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV), kBase == 2 && kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV), kBase == 3 && kDerived >= 1); EXPECT_THAT((IsBracesConstructibleV), kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV), kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV, int>), - kDerived >= 1); - EXPECT_THAT( - (IsBracesConstructibleV, AnyType>), - kDerived > 0); - - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 0 && kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 1 && kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 2 && kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 3 && kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV, int, int>), - kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV, AnyType, int>), - kDerived >= 2); - EXPECT_THAT( - (IsBracesConstructibleV< - Type, AnyBaseType, AnyType, AnyType>), - kDerived >= 2); - - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 0 && kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 1 && kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 2 && kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kBase == 3 && kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV, int, int, int>), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV< - Type, AnyBaseType, AnyType, int, int>), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV< - Type, AnyBaseType, AnyType, AnyType, int>), - kDerived >= 3); - EXPECT_THAT( - (IsBracesConstructibleV< - Type, AnyBaseType, AnyType, AnyType, AnyType>), - kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV, int>), kDerived >= 1); + EXPECT_THAT((IsBracesConstructibleV, AnyType>), kDerived > 0); + + EXPECT_THAT((IsBracesConstructibleV), kBase == 0 && kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kBase == 1 && kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kBase == 2 && kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kBase == 3 && kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV, int, int>), kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV, AnyType, int>), kDerived >= 2); + EXPECT_THAT((IsBracesConstructibleV, AnyType, AnyType>), kDerived >= 2); + + EXPECT_THAT((IsBracesConstructibleV), kBase == 0 && kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kBase == 1 && kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kBase == 2 && kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kBase == 3 && kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV, int, int, int>), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV, AnyType, int, int>), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV, AnyType, AnyType, int>), kDerived >= 3); + EXPECT_THAT((IsBracesConstructibleV, AnyType, AnyType, AnyType>), kDerived >= 3); } } // namespace diff --git a/mbo/types/tstring.h b/mbo/types/tstring.h index 81cc82c..32b7c58 100644 --- a/mbo/types/tstring.h +++ b/mbo/types/tstring.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,11 +27,11 @@ namespace mbo::types { // NOLINTBEGIN(readability-identifier-naming) #ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" #elif defined(__GNUC__) -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpedantic" +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wpedantic" #endif // Implements type `tstring` a compile time string-literal type. @@ -571,9 +572,9 @@ constexpr auto make_ts(const char(&str)[N]) noexcept { }(std::make_index_sequence{}) #ifdef __clang__ -#pragma clang diagnostic pop +# pragma clang diagnostic pop #elif defined(__GNUC__) -#pragma GCC diagnostic pop +# pragma GCC diagnostic pop #endif // NOLINTEND(readability-identifier-naming) diff --git a/mbo/types/tstring_test.cc b/mbo/types/tstring_test.cc index 940eee6..171d75c 100644 --- a/mbo/types/tstring_test.cc +++ b/mbo/types/tstring_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,12 +33,12 @@ namespace { // NOLINTBEGIN(readability-static-accessed-through-instance) // NOLINTBEGIN(readability-static-definition-in-anonymous-namespace) +using std::size_t; using ::testing::Conditional; using ::testing::IsEmpty; using ::testing::Not; using ::testing::SizeIs; using ::testing::StrEq; -using std::size_t; static_assert(sizeof(""_ts) == 1); static_assert(""_ts.empty()); diff --git a/mbo/types/tuple.h b/mbo/types/tuple.h index c7b8274..fb83886 100644 --- a/mbo/types/tuple.h +++ b/mbo/types/tuple.h @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/mbo/types/tuple_test.cc b/mbo/types/tuple_test.cc index 7f4ba7a..4025631 100644 --- a/mbo/types/tuple_test.cc +++ b/mbo/types/tuple_test.cc @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,10 +35,8 @@ class TupleTest : public ::testing::Test {}; template class GenTupleTest : public ::testing::Test { public: - static constexpr std::size_t kDerivedFieldCount = - static_cast(T::kFieldCount); - static constexpr std::size_t kBaseFieldCount = - static_cast(T::BaseType::kFieldCount); + static constexpr std::size_t kDerivedFieldCount = static_cast(T::kFieldCount); + static constexpr std::size_t kBaseFieldCount = static_cast(T::BaseType::kFieldCount); }; TYPED_TEST_SUITE(GenTupleTest, AllConstructedTypes); @@ -50,9 +49,7 @@ TEST_F(TupleTest, StructCtorArgCountMax) { } TYPED_TEST(GenTupleTest, StructCtorArgCountMax) { - EXPECT_THAT( - types_internal::StructCtorArgCountMaxV, - TestFixture::kDerivedFieldCount + 1) + EXPECT_THAT(types_internal::StructCtorArgCountMaxV, TestFixture::kDerivedFieldCount + 1) << "The field count sums all derived fields and counts each base as 1."; } @@ -63,9 +60,7 @@ TEST_F(TupleTest, AggregateHasNonEmptyBase) { } TYPED_TEST(GenTupleTest, AggregateHasNonEmptyBase) { - EXPECT_THAT( - types_internal::AggregateHasNonEmptyBase, - TestFixture::kBaseFieldCount != 0); + EXPECT_THAT(types_internal::AggregateHasNonEmptyBase, TestFixture::kBaseFieldCount != 0); } TEST_F(TupleTest, StructToTupleNoDerived) { @@ -87,8 +82,7 @@ TEST_F(TupleTest, Mixed) { std::string_view d; }; - const std::tuple test0 = - StructToTuple(Mixed{1, 2.2, "3", "4"}); + const std::tuple test0 = StructToTuple(Mixed{1, 2.2, "3", "4"}); EXPECT_THAT(test0, std::tuple(1, 2.2, "3", "4")); } diff --git a/test_all.sh b/test_all.sh index 1bb8194..d58c209 100755 --- a/test_all.sh +++ b/test_all.sh @@ -1,7 +1,7 @@ #!/bin/bash -# Copyright M. Boerger (helly25.com) -# +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at diff --git a/tools/check_headers.sh b/tools/check_headers.sh index 6c7fc32..11e56e9 100755 --- a/tools/check_headers.sh +++ b/tools/check_headers.sh @@ -1,6 +1,7 @@ #!/bin/bash -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,8 +21,17 @@ bazel build -c opt //mbo/diff:unified_diff UNIFIED_DIFF="bazel-bin/mbo/diff/unified_diff" +if [[ $(find -E . >/dev/null 2>&1) ]]; then + FLAGS="-P -E" +else + FLAGS="-P" +fi + +rm -f /tmp/header-diffs.txt +touch /tmp/header-diffs.txt + MAX_LINES=$(wc -l tools/header_cpp.txt | sed -e 's,^ *,,g' | cut -d ' ' -f 1) -find -E . -regex '.*[.](c|cc|cpp|h|hh|hpp)([.]mope)?$' \ +find "${FLAGS}" . -regex '.*[.](c|cc|cpp|h|hh|hpp)([.]mope)?$' \ -exec "${UNIFIED_DIFF}" \ --file_header_use left \ --ignore_matching_lines="^($|([^/]($|[^/])))" \ @@ -29,10 +39,10 @@ find -E . -regex '.*[.](c|cc|cpp|h|hh|hpp)([.]mope)?$' \ {} \ tools/header_cpp.txt > /tmp/diff-{} \ \; \ - > /tmp/header-diffs.txt + >> /tmp/header-diffs.txt MAX_LINES=$(wc -l tools/header.txt | sed -e 's, *, ,g' | cut -d ' ' -f 2) -find -E . -regex '.*/(.*[.](bzl|bazel)|BAZEL|WORKSPACE)$' \ +find "${FLAGS}" . -regex '.*/(.*[.](bzl|bazel)|BAZEL|WORKSPACE)$' \ -exec "${UNIFIED_DIFF}" \ --file_header_use left \ --ignore_matching_lines="^($|[^#])" \ @@ -43,7 +53,7 @@ find -E . -regex '.*/(.*[.](bzl|bazel)|BAZEL|WORKSPACE)$' \ >> /tmp/header-diffs.txt MAX_LINES=$(wc -l tools/header_sh.txt | sed -e 's, *, ,g' | cut -d ' ' -f 2) -find -E . -regex '.*[.](sh)$' \ +find "${FLAGS}" . -regex '.*[.](sh)$' \ -exec "${UNIFIED_DIFF}" \ --file_header_use left \ --ignore_matching_lines="^($|[^#]|(#!/bin/bash$))" \ diff --git a/tools/header.txt b/tools/header.txt index 40bcf8c..9dfe50f 100644 --- a/tools/header.txt +++ b/tools/header.txt @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tools/header_cpp.txt b/tools/header_cpp.txt index a02443e..782f2e4 100644 --- a/tools/header_cpp.txt +++ b/tools/header_cpp.txt @@ -1,4 +1,5 @@ -// Copyright M. Boerger (helly25.com) +// SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +// SPDX-License-Identifier: Apache-2.0 // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/tools/header_sh.txt b/tools/header_sh.txt index 1bb8194..7a88cb7 100644 --- a/tools/header_sh.txt +++ b/tools/header_sh.txt @@ -1,6 +1,7 @@ #!/bin/bash -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/workspace.bzl b/workspace.bzl index 03f5a87..4137b51 100644 --- a/workspace.bzl +++ b/workspace.bzl @@ -1,4 +1,5 @@ -# Copyright M. Boerger (helly25.com) +# SPDX-FileCopyrightText: Copyright (c) The helly25/mbo authors (helly25.com) +# SPDX-License-Identifier: Apache-2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License.