Skip to content

Commit c627af8

Browse files
committed
docs: ignore UNLIMITED constant in DynamicDocstrings extension
it messes with the docstring for some reason
1 parent a73708d commit c627af8

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

mkdocs.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ plugins:
6161
show_symbol_type_toc: true
6262
show_symbol_type_heading: true
6363
extensions:
64-
- scripts/griffe_exts.py:DynamicDocstrings
64+
- scripts/griffe_exts.py:DynamicDocstrings:
65+
ignore_paths:
66+
- pyslurm.constants.UNLIMITED
6567

6668
markdown_extensions:
6769
- admonition

scripts/griffe_exts.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,11 @@ def replace_with_slurm_docs_url(match):
6666
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
6767
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
6868
class DynamicDocstrings(griffe.Extension):
69-
def __init__(self, object_paths: list[str] | None = None) -> None:
70-
self.object_paths = object_paths
69+
def __init__(self, include_paths: list[str] | None = None,
70+
ignore_paths: list[str] | None = None) -> None:
71+
72+
self.include_paths = include_paths
73+
self.ignore_paths = ignore_paths
7174

7275
def on_instance(
7376
self,
@@ -76,7 +79,9 @@ def on_instance(
7679
agent: griffe.Visitor | griffe.Inspector,
7780
**kwargs,
7881
) -> None:
79-
if self.object_paths and obj.path not in self.object_paths:
82+
83+
if ((self.include_paths and obj.path not in self.include_paths)
84+
or (self.ignore_paths and obj.path in self.ignore_paths)):
8085
return
8186

8287
try:

0 commit comments

Comments
 (0)