Skip to content

Commit 891c0ec

Browse files
committed
Linting
1 parent fff3c61 commit 891c0ec

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

include/pybind11/pybind11.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,7 +1545,7 @@ class module_ : public object {
15451545
Overload of `def` taking the function name as a ``std::string``.
15461546
\endrst */
15471547
template <typename Func, typename... Extra>
1548-
module_ &def(const std::string& name_, Func &&f, const Extra &...extra) {
1548+
module_ &def(const std::string &name_, Func &&f, const Extra &...extra) {
15491549
return def(name_.c_str(), f, std::forward<Extra>(extra)...);
15501550
}
15511551

@@ -1598,16 +1598,14 @@ class module_ : public object {
15981598
/** \rst
15991599
Overload of `def_submodule` taking the function name and documentation as ``std::string``.
16001600
\endrst */
1601-
module_ def_submodule(const std::string& name, const std::string& doc) {
1601+
module_ def_submodule(const std::string &name, const std::string &doc) {
16021602
return def_submodule(name.c_str(), doc.c_str());
16031603
}
16041604

16051605
/** \rst
16061606
Overload of `def_submodule` taking the function name as a ``std::string``.
16071607
\endrst */
1608-
module_ def_submodule(const std::string& name) {
1609-
return def_submodule(name.c_str(), nullptr);
1610-
}
1608+
module_ def_submodule(const std::string &name) { return def_submodule(name.c_str(), nullptr); }
16111609

16121610
/// Import and return a module or throws `error_already_set`.
16131611
static module_ import(const char *name) {
@@ -1621,9 +1619,7 @@ class module_ : public object {
16211619
/** \rst
16221620
Overload of `import` taking the function name as a ``std::string``.
16231621
\endrst */
1624-
static module_ import(const std::string& name) {
1625-
return import(name.c_str());
1626-
}
1622+
static module_ import(const std::string &name) { return import(name.c_str()); }
16271623

16281624
/// Reload the module or throws `error_already_set`.
16291625
void reload() {
@@ -1654,7 +1650,8 @@ class module_ : public object {
16541650
/** \rst
16551651
Overload of `add_object` taking the function name as a ``std::string``.
16561652
\endrst */
1657-
PYBIND11_NOINLINE void add_object(const std::string& name, handle obj, bool overwrite = false) {
1653+
PYBIND11_NOINLINE void
1654+
add_object(const std::string &name, handle obj, bool overwrite = false) {
16581655
return add_object(name.c_str(), obj, overwrite);
16591656
}
16601657

@@ -1700,10 +1697,11 @@ class module_ : public object {
17001697
}
17011698

17021699
/** \rst
1703-
Overload of `create_extension_module` taking the module name and documentation as ``std::string``.
1700+
Overload of `create_extension_module` taking the module name and documentation as
1701+
``std::string``.
17041702
\endrst */
1705-
static module_ create_extension_module(const std::string& name,
1706-
const std::string& doc,
1703+
static module_ create_extension_module(const std::string &name,
1704+
const std::string &doc,
17071705
PyModuleDef *def,
17081706
mod_gil_not_used gil_not_used
17091707
= mod_gil_not_used(false)) {

tests/test_modules.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,6 @@ TEST_SUBMODULE(modules, m) {
124124

125125
// Test std::string versions of def_submodule and def
126126
py::module m_sub_string = m.def_submodule(std::string("submodule_string"));
127-
m_sub_string.def(std::string("submodule_string_func"), []() { return "submodule_string_func()"; });
127+
m_sub_string.def(std::string("submodule_string_func"),
128+
[]() { return "submodule_string_func()"; });
128129
}

0 commit comments

Comments
 (0)