From bf869b0e075c65aa0f81d148b42a90dcce2f95c5 Mon Sep 17 00:00:00 2001 From: Sangar Date: Sat, 5 Jul 2025 21:54:07 +0200 Subject: Add IWYU pragmas for provider header (#277) --- include/toml++/toml.hpp | 2 ++ tools/generate_single_header.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/toml++/toml.hpp b/include/toml++/toml.hpp index 61790c7433..0717cc458e 100644 --- a/include/toml++/toml.hpp +++ b/include/toml++/toml.hpp @@ -31,6 +31,7 @@ TOML_PRAGMA_CLANG(diagnostic ignored "-Wreserved-identifier") #endif #endif +// IWYU pragma: begin_exports #include "impl/std_new.hpp" #include "impl/std_string.hpp" #include "impl/std_optional.hpp" @@ -56,6 +57,7 @@ TOML_PRAGMA_CLANG(diagnostic ignored "-Wreserved-identifier") #include "impl/toml_formatter.hpp" #include "impl/json_formatter.hpp" #include "impl/yaml_formatter.hpp" +// IWYU pragma: end_exports #if TOML_IMPLEMENTATION diff --git a/tools/generate_single_header.py b/tools/generate_single_header.py index f28748969f..fed4ae4e1e 100755 --- a/tools/generate_single_header.py +++ b/tools/generate_single_header.py @@ -122,6 +122,8 @@ def main(): toml_h = re.sub(r'([^@][({,])\n\n', r'\1\n', toml_h) # blank lines preceeding closing brackets toml_h = re.sub(r'\n\n([ \t]*[})])', r'\n\1', toml_h) + # IWYU pragmas + toml_h = re.sub(r'\n// IWYU pragma: [^\n]+\n', '\n', toml_h) # ensure only one trailing newline toml_h = toml_h.strip() + '\n' -- cgit 0.0.5-2-1-g0f52