Skip to content

Commit 9422ee0

Browse files
committed
add linter flag removal to conf.py docstring rendering
1 parent 971b9b6 commit 9422ee0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/source/conf.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@
3838

3939
html_theme = "furo"
4040
html_static_path = ["_static"]
41+
42+
# remove linter flags from rendered docstrings
43+
44+
45+
def remove_linter_flags(app, what, name, obj, options, lines):
46+
for index, line in enumerate(lines):
47+
if "# noqa" in line or "# no-cython-lint" in line:
48+
lines[index] = line.split("#")[0].rstrip()
49+
50+
51+
def setup(app):
52+
app.connect("autodoc-process-docstring", remove_linter_flags)

0 commit comments

Comments
 (0)