Skip to content

Commit e379d5d

Browse files
committed
fix: run clang-tidy action locally and fix remaining issues
1 parent 63f0695 commit e379d5d

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

include/pybind11/pytypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,8 @@ class capsule : public object {
16051605
pybind11_fail("Could not allocate capsule object!");
16061606
}
16071607

1608-
// NOLINTNEXTLINE(google-explicit-constructor)
16091608
template <typename T>
1609+
// NOLINTNEXTLINE(google-explicit-constructor)
16101610
operator T *() const {
16111611
return get_pointer<T>();
16121612
}

tests/test_numpy_dtypes.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ template <typename S>
160160
py::array_t<S, 0> create_recarray(size_t n) {
161161
auto arr = mkarray_via_buffer<S>(n);
162162
auto req = arr.request();
163-
auto ptr = static_cast<S *>(req.ptr);
163+
auto *ptr = static_cast<S *>(req.ptr);
164164
for (size_t i = 0; i < n; i++) {
165165
SET_TEST_VALS(ptr[i], i);
166166
}
@@ -170,7 +170,7 @@ py::array_t<S, 0> create_recarray(size_t n) {
170170
template <typename S>
171171
py::list print_recarray(py::array_t<S, 0> arr) {
172172
const auto req = arr.request();
173-
const auto ptr = static_cast<S *>(req.ptr);
173+
const auto *ptr = static_cast<S *>(req.ptr);
174174
auto l = py::list();
175175
for (py::ssize_t i = 0; i < req.size; i++) {
176176
std::stringstream ss;

tests/test_stl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,9 @@ TEST_SUBMODULE(stl, m) {
395395
m.def("half_or_none_refsensitive", [](int x) -> refsensitive_opt_int {
396396
return x != 0 ? refsensitive_opt_int(x / 2) : refsensitive_opt_int();
397397
});
398-
// NOLINTNEXTLINE(performance-unnecessary-value-param)
399398
m.def(
400399
"test_nullopt_refsensitive",
400+
// NOLINTNEXTLINE(performance-unnecessary-value-param)
401401
[](refsensitive_opt_int x) { return x ? x.value() : 42; },
402402
py::arg_v("x", refsensitive_opt_int(), "None"));
403403
m.def(

tests/test_stl_binders.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,23 +43,23 @@ class E_nc {
4343

4444
template <class Container>
4545
Container *one_to_n(int n) {
46-
auto v = new Container();
46+
auto *v = new Container();
4747
for (int i = 1; i <= n; i++)
4848
v->emplace_back(i);
4949
return v;
5050
}
5151

5252
template <class Map>
5353
Map *times_ten(int n) {
54-
auto m = new Map();
54+
auto *m = new Map();
5555
for (int i = 1; i <= n; i++)
5656
m->emplace(int(i), E_nc(10 * i));
5757
return m;
5858
}
5959

6060
template <class NestMap>
6161
NestMap *times_hundred(int n) {
62-
auto m = new NestMap();
62+
auto *m = new NestMap();
6363
for (int i = 1; i <= n; i++)
6464
for (int j = 1; j <= n; j++)
6565
(*m)[i].emplace(int(j * 10), E_nc(100 * j));

0 commit comments

Comments
 (0)