|
12 | 12 | from pathlib import Path |
13 | 13 | from typing import TYPE_CHECKING, Any, Callable, Match, Pattern, Sequence |
14 | 14 |
|
15 | | -from griffe.dataclasses import Alias, Object |
16 | | -from griffe.docstrings.dataclasses import ( |
| 15 | +from griffe import ( |
| 16 | + Alias, |
17 | 17 | DocstringSectionAttributes, |
18 | 18 | DocstringSectionClasses, |
19 | 19 | DocstringSectionFunctions, |
20 | 20 | DocstringSectionModules, |
| 21 | + Object, |
21 | 22 | ) |
22 | 23 | from jinja2 import TemplateNotFound, pass_context, pass_environment |
23 | 24 | from markupsafe import Markup |
24 | 25 | from mkdocstrings.loggers import get_logger |
25 | 26 |
|
26 | 27 | if TYPE_CHECKING: |
27 | | - from griffe.dataclasses import Attribute, Class, Function, Module |
| 28 | + from griffe import Attribute, Class, Function, Module |
28 | 29 | from jinja2 import Environment, Template |
29 | 30 | from jinja2.runtime import Context |
30 | 31 | from mkdocstrings.handlers.base import CollectorItem |
@@ -364,11 +365,9 @@ def _keep_object(name: str, filters: Sequence[tuple[Pattern, bool]]) -> bool: |
364 | 365 | if regex.search(name): |
365 | 366 | keep = not exclude |
366 | 367 | if keep is None: |
367 | | - if rules == {False}: |
368 | | - # only included stuff, no match = reject |
369 | | - return False |
370 | | - # only excluded stuff, or included and excluded stuff, no match = keep |
371 | | - return True |
| 368 | + # When we only include stuff, no match = reject. |
| 369 | + # When we only exclude stuff, or include and exclude stuff, no match = keep. |
| 370 | + return rules != {False} |
372 | 371 | return keep |
373 | 372 |
|
374 | 373 |
|
|
0 commit comments