Skip to content

Commit 46696f4

Browse files
authored
Add sphinx-lint to pre-commit and fix errors (#597)
As suggested by @kaeun97 in #596. This catches some (but not all) errors in the docs that are not picked up by sphinx-build. The errors this does pick up in the existing docs, that are corrected, are: ``` docs/source/user/cuda_compilation.rst:132: OMG TABS!!!1 (horizontal-tab) docs/source/user/cuda_compilation.rst:133: OMG TABS!!!1 (horizontal-tab) docs/source/user/random.rst:90: found an unbalanced inline literal markup. (unbalanced-inline-literals-delimiters) docs/source/user/random.rst:27: missing underscore after closing backtick in hyperlink (missing-underscore-after-hyperlink) ```
1 parent 911dafd commit 46696f4

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,7 @@ repos:
3030
language: python
3131
additional_dependencies:
3232
- pathspec==0.12.1
33+
- repo: https://github.com/sphinx-contrib/sphinx-lint
34+
rev: v1.0.2
35+
hooks:
36+
- id: sphinx-lint

docs/source/user/cuda_compilation.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ placed in the return value:
129129

130130
.. code:: text
131131
132-
add.s32 %r3, %r2, %r1;
133-
st.param.b32 [func_retval0+0], %r3;
132+
add.s32 %r3, %r2, %r1;
133+
st.param.b32 [func_retval0+0], %r3;
134134
135135
To distinguish one variant of the compiled ``add()`` function from another, the
136136
following example specifies its ABI name in the ``abi_info`` dict:

docs/source/user/random.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ as well as CUDA device functions to obtain uniformly or normally distributed
2424
random numbers.
2525

2626
.. note:: Numba (like cuRAND) uses the
27-
`Box-Muller transform <https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform>`
27+
`Box-Muller transform <https://en.wikipedia.org/wiki/Box%E2%80%93Muller_transform>`_
2828
to generate normally distributed random numbers from a uniform generator.
2929
However, Box-Muller generates pairs of random numbers, and the current
3030
implementation only returns one of them. As a result, generating normally
@@ -87,7 +87,7 @@ Instead, it uses a fixed size 3D grid with a total of 2,097,152 (``(16 ** 3) *
8787

8888
.. literalinclude:: ../../../numba_cuda/numba/cuda/tests/doc_examples/test_random.py
8989
:language: python
90-
:caption: from ``test_ex_3d_grid of ``numba/cuda/tests/doc_example/test_random.py``
90+
:caption: from ``test_ex_3d_grid`` of ``numba/cuda/tests/doc_example/test_random.py``
9191
:start-after: magictoken.ex_3d_grid.begin
9292
:end-before: magictoken.ex_3d_grid.end
9393
:dedent: 8

0 commit comments

Comments
 (0)