Skip to content

Commit df29558

Browse files
committed
support implied whitelist rules
#feat fix #797
1 parent b7b2f37 commit df29558

13 files changed

+1171
-332
lines changed

docs/modules/ROOT/pages/config-file.adoc

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,6 @@ see-below:
156156
- 'my_library::see_below::**'
157157
----
158158

159-
Symbols are only checked against the `implementation-detail` and `see-below` options if they match the `include-symbols` option.
160-
161159
[,cpp]
162160
----
163161
namespace my_library
@@ -184,6 +182,21 @@ namespace my_library
184182
}
185183
----
186184

185+
=== Whitelisting Rules
186+
187+
The rules for whitelisting symbols (`include-symbols`, `implementation-defined`, and `see-below`) are less strict than the rules for blacklisting symbols (`exclude-symbols`). A symbol is considered whitelisted if it matches any of the following conditions:
188+
189+
1. The symbol strictly matches one of the patterns.
190+
** For instance, the patterns `std::vector` and `std::*` both match `std::vector` strictly.
191+
2. The symbol is a parent namespace of an included symbol.
192+
** For instance, the pattern `std::filesystem::*` also includes `std` and `std::filesystem`.
193+
3. The parent symbol is also included.
194+
** For instance, the pattern `std::*` also matches `std::vector::iterator` because `std::vector::iterator` is a member of `std::vector`, which is matches the pattern.
195+
4. The symbol is a child of a literal pattern representing a namespace.
196+
** For instance, the literal pattern `std` matches `std::filesystem::path::iterator` because `std` is a literal pattern matching a namespace. In other words, these literal patterns represent the namespace and its subnamespaces as if the pattern were `std::**`.
197+
198+
For exclusion rules, the symbol must strictly match the pattern to be excluded.
199+
187200
[#config-options-reference]
188201
== Reference
189202

0 commit comments

Comments
 (0)