From f8a85824213d24a69b7a6c3c4e62700b08c46e74 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:08:44 +0200 Subject: [PATCH 1/3] Add test for default role in indented C contstruct block --- tests/fixtures/xfail/default-role-in-c-type.rst | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/fixtures/xfail/default-role-in-c-type.rst diff --git a/tests/fixtures/xfail/default-role-in-c-type.rst b/tests/fixtures/xfail/default-role-in-c-type.rst new file mode 100644 index 000000000..aed83182c --- /dev/null +++ b/tests/fixtures/xfail/default-role-in-c-type.rst @@ -0,0 +1,8 @@ +.. expect: default role used (hint: for inline literals, use double backticks) (default-role) + +.. c:type:: int (*PyCode_WatchCallback)(PyCodeEvent event, PyCodeObject* co) + + If *event* is ``PY_CODE_EVENT_CREATE``, then the callback is invoked + after `co` has been fully initialized. Otherwise, the callback is invoked + before the destruction of *co* takes place, so the prior state of *co* + can be inspected. From 46c4384c66e295c566c2da6dc2e5c8a2095c860d Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:33:36 +0200 Subject: [PATCH 2/3] Include C construct directives for RST checks --- sphinxlint/rst.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinxlint/rst.py b/sphinxlint/rst.py index 0e8b7b473..ca868dfd4 100644 --- a/sphinxlint/rst.py +++ b/sphinxlint/rst.py @@ -60,7 +60,10 @@ # fmt: off DIRECTIVES_CONTAINING_RST = [ # standard docutils ones - 'admonition', 'attention', 'caution', 'class', 'compound', 'container', + 'admonition', 'attention', + 'c:data', 'c:enum', 'c:enumerator', 'c:func', 'c:macro', 'c:member', + 'c:struct', 'c:type', 'c:union', 'c:var', + 'caution', 'class', 'compound', 'container', 'danger', 'epigraph', 'error', 'figure', 'footer', 'header', 'highlights', 'hint', 'image', 'important', 'include', 'line-block', 'list-table', 'meta', 'note', 'parsed-literal', 'pull-quote', 'replace', 'sidebar', 'tip', 'topic', From 3db78e94cbcf85b81f56bb63579b20b9d507687e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 16 Jan 2024 18:34:26 +0200 Subject: [PATCH 3/3] Ignore coverage data files --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c92356674..dba7db8d5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ dist/ __pycache__/ *.egg-info/ .coverage +.coverage.* .envrc .tox/ .venv/