Go all the way fixing clang-tidy issues to avoid the NOLINTNEXTLINE clutter and clang-format issues. This was really meant to be part of PR #3051 but was held back either out of an abundance of caution, or because of confusion caused by stray semicolons. (#3086)

This commit is contained in:
Ralf W. Grosse-Kunstleve
2021-07-09 14:09:56 -07:00
committed by GitHub
parent b5357d1fa8
commit bac5a0c370
4 changed files with 29 additions and 14 deletions

View File

@@ -10,9 +10,12 @@
#include "pybind11_tests.h"
#include "local_bindings.h"
#include <pybind11/stl.h>
#include <pybind11/stl_bind.h>
#include <numeric>
#include <utility>
TEST_SUBMODULE(local_bindings, m) {
// test_load_external
@@ -86,9 +89,10 @@ TEST_SUBMODULE(local_bindings, m) {
m.def("return_self", [](LocalVec *v) { return v; });
m.def("return_copy", [](const LocalVec &v) { return LocalVec(v); });
// Reformatting this class broke pygrep checks
// NOLINTNEXTLINE
class Cat : public pets::Pet { public: Cat(std::string name) : Pet(name) {}; };
class Cat : public pets::Pet {
public:
Cat(std::string name) : Pet(std::move(name)) {}
};
py::class_<pets::Pet>(m, "Pet", py::module_local())
.def("get_name", &pets::Pet::name);
// Binding for local extending class: