Adding .clang-tidy readability-braces-around-statements option.

clang-tidy automatic changes. NO manual changes.
This commit is contained in:
Ralf W. Grosse-Kunstleve
2022-02-07 16:23:20 -08:00
committed by Ralf W. Grosse-Kunstleve
parent 8581584e60
commit ddbc74c674
49 changed files with 1364 additions and 679 deletions

View File

@@ -136,11 +136,16 @@ TEST_SUBMODULE(callbacks, m) {
m.def("dummy_function_overloaded", [](int i, int j) { return i + j; });
m.def("dummy_function_overloaded", &dummy_function);
m.def("dummy_function2", [](int i, int j) { return i + j; });
m.def("roundtrip", [](std::function<int(int)> f, bool expect_none = false) {
if (expect_none && f)
throw std::runtime_error("Expected None to be converted to empty std::function");
return f;
}, py::arg("f"), py::arg("expect_none")=false);
m.def(
"roundtrip",
[](std::function<int(int)> f, bool expect_none = false) {
if (expect_none && f) {
throw std::runtime_error("Expected None to be converted to empty std::function");
}
return f;
},
py::arg("f"),
py::arg("expect_none") = false);
m.def("test_dummy_function", [](const std::function<int(int)> &f) -> std::string {
using fn_type = int (*)(int);
auto result = f.target<fn_type>();
@@ -215,8 +220,9 @@ TEST_SUBMODULE(callbacks, m) {
};
// spawn worker threads
for (auto i : work)
for (auto i : work) {
start_f(py::cast<int>(i));
}
});
m.def("callback_num_times", [](const py::function &f, std::size_t num) {