Skip to content

Commit

Permalink
Add pybind11 IWYU pragmas (for clangd Include Cleaner).
Browse files Browse the repository at this point in the history
Adopt the

```
// IWYU pragma: always_keep // See pybind11/docs/type_caster_iwyu.rst
```

comment used in google/pybind11clif#30073.

Currently pybind11/docs/type_caster_iwyu.rst only exists in google/pybind11clif#30073, but the intend is to upstream the changes (see PR description).

See also: https://clangd.llvm.org/design/include-cleaner

PiperOrigin-RevId: 577074824
  • Loading branch information
Ralf W. Grosse-Kunstleve authored and copybara-github committed Oct 27, 2023
1 parent 24a1111 commit b749fd6
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pybind11_protobuf/enum_type_caster.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// IWYU pragma: private, include "pybind11_protobuf/native_proto_caster.h"

#ifndef PYBIND11_PROTOBUF_ENUM_TYPE_CASTER_H_
#define PYBIND11_PROTOBUF_ENUM_TYPE_CASTER_H_

Expand Down
2 changes: 2 additions & 0 deletions pybind11_protobuf/native_proto_caster.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// IWYU pragma: always_keep // See pybind11/docs/type_caster_iwyu.rst

#ifndef PYBIND11_PROTOBUF_NATIVE_PROTO_CASTERS_H_
#define PYBIND11_PROTOBUF_NATIVE_PROTO_CASTERS_H_

Expand Down
2 changes: 2 additions & 0 deletions pybind11_protobuf/proto_cast_util.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// IWYU pragma: private, include "pybind11_protobuf/native_proto_caster.h"

#ifndef PYBIND11_PROTOBUF_PROTO_CAST_UTIL_H_
#define PYBIND11_PROTOBUF_PROTO_CAST_UTIL_H_

Expand Down
2 changes: 2 additions & 0 deletions pybind11_protobuf/proto_caster_impl.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// IWYU pragma: private, include "pybind11_protobuf/native_proto_caster.h"

#ifndef PYBIND11_PROTOBUF_PROTO_CASTER_IMPL_H_
#define PYBIND11_PROTOBUF_PROTO_CASTER_IMPL_H_

Expand Down
2 changes: 2 additions & 0 deletions pybind11_protobuf/wrapped_proto_caster.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// IWYU pragma: always_keep // See pybind11/docs/type_caster_iwyu.rst

#ifndef PYBIND11_PROTOBUF_WRAPPED_PROTO_CASTER_H_
#define PYBIND11_PROTOBUF_WRAPPED_PROTO_CASTER_H_

Expand Down

0 comments on commit b749fd6

Please sign in to comment.