Explain linting suppressions (#5790)

* Reduce NOLINT

* Revert "Reduce NOLINT"

This reverts commit 96593d3142.

* Explain NOLINT

We explicitly want to test copying the argument.
This commit is contained in:
Robert Haschke
2025-08-12 04:34:37 +02:00
committed by GitHub
parent 94c8250818
commit 6292b704f6

View File

@@ -193,11 +193,9 @@ TEST_SUBMODULE(copy_move_policies, m) {
// test_move_and_copy_loads
m.def("move_only", [](MoveOnlyInt m) { return m.value; });
// Changing this breaks the existing test: needs careful review.
// NOLINTNEXTLINE(performance-unnecessary-value-param)
// NOLINTNEXTLINE(performance-unnecessary-value-param): we want to test copying
m.def("move_or_copy", [](MoveOrCopyInt m) { return m.value; });
// Changing this breaks the existing test: needs careful review.
// NOLINTNEXTLINE(performance-unnecessary-value-param)
// NOLINTNEXTLINE(performance-unnecessary-value-param): we want to test copying
m.def("copy_only", [](CopyOnlyInt m) { return m.value; });
m.def("move_pair",
[](std::pair<MoveOnlyInt, MoveOrCopyInt> p) { return p.first.value + p.second.value; });