<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/89989>89989</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang-include-cleaner: Consider supporting `IWYU pragma: no_include`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          crisluengo
      </td>
    </tr>
</table>

<pre>
    According to the documentation for clang-include-cleaner at <https://clangd.llvm.org/design/include-cleaner#iwyu-pragmas>, the IWYU pragma `no_include` is not supported (and I see it not having an effect in my IDE).

Plenty of libraries are designed for the user to include a single header file, not any of the private implementation files, but don't have any IWYU pragmas to indicate this to clang-tidy. And let's be honest, it'll be a long time before all software is making good use of IWYU pragmas.

As a user of these libraries, we can either turn off the misc-include-cleaner test in clang-tidy, or try to ignore the warnings in the IDE. Neither is ideal. If the library is open-source, of course, we could also submit a PR to the library in the hopes the owner cares. Currently the only way to suppress the warning is to add `// NOLINT(*-include-cleaner)` to each line that uses functionality from this library. This is of course highly impractical.

A simple and practical solution for the user would be to add `// IWYU pragma: no_include "library/private/*"` to the source file.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VEuP6zYP_TXyhojhyHl54UW-mQkwwIfpRXGLoqtClmhbrSwFojyB_31BOfO6t93kIYnkOYeHVER28Iit2P9P7B8LNacxxFZHS25GP4SiC2Zpz1qHaKwfIAVII4IJep7QJ5Vs8NCHCNopP2ys1242uNEOlccIKoGoH8aUriTqs5AXIS_5pSmde53KEAchLwYZhZCXH8KFrO1tmTfXqIZJkaifhHzI9Z9__-M3WI9BHCof_ryHikMFlsCHBDRfryEmNCDkSXkDz0CIYFO-HdUr81EesO9RJ7AepgWeH5-EbEpRPYrqvH5-c-jTAqEHZ7uookUCFRFW1GgyfQY1E0YW6A4FFJD1g0MYURmM0FuHTIDLK58zct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