Skip to content

Commit 50bae03

Browse files
authored
Rst linting (#285)
* add sphinx-lint and fix issues reported * fix some other minor issues
1 parent 3b35d1a commit 50bae03

4 files changed

Lines changed: 11 additions & 5 deletions

File tree

.pre-commit-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,8 @@ repos:
9393
hooks:
9494
- id: pretty-format-toml
9595
args: [--autofix]
96+
97+
- repo: https://github.com/sphinx-contrib/sphinx-lint
98+
rev: v0.9.1
99+
hooks:
100+
- id: sphinx-lint

docs/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Changelog
33
#########
44

5-
*[CalVer, YY.month.patch](https://calver.org/)*
5+
`CalVer, YY.month.patch <https://calver.org/>`_
66

77
24.9.1
88
======
@@ -182,7 +182,7 @@ Changelog
182182

183183
22.11.2
184184
=======
185-
- TRIO105 now also checks that you ``await``ed ``nursery.start()``.
185+
- TRIO105 now also checks that you ``await``\ed ``nursery.start()``.
186186

187187
22.11.1
188188
=======

docs/rules.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ _`ASYNC120` : await-in-except
8484
This is currently not able to detect asyncio shields.
8585

8686
_`ASYNC121`: control-flow-in-taskgroup
87-
`return`, `continue`, and `break` inside a :ref:`taskgroup_nursery` can lead to counterintuitive behaviour. Refactor the code to instead cancel the :ref:`cancel_scope` inside the TaskGroup/Nursery and place the statement outside of the TaskGroup/Nursery block. In asyncio a user might expect the statement to have an immediate effect, but it will wait for all tasks to finish before having an effect. See `Trio issue #1493 <https://github.com/python-trio/trio/issues/1493>` for further issues specific to trio/anyio.
87+
`return`, `continue`, and `break` inside a :ref:`taskgroup_nursery` can lead to counterintuitive behaviour. Refactor the code to instead cancel the :ref:`cancel_scope` inside the TaskGroup/Nursery and place the statement outside of the TaskGroup/Nursery block. In asyncio a user might expect the statement to have an immediate effect, but it will wait for all tasks to finish before having an effect. See `Trio issue #1493 <https://github.com/python-trio/trio/issues/1493>`_ for further issues specific to trio/anyio.
8888

8989

9090
Blocking sync calls in async functions
@@ -194,6 +194,7 @@ _`ASYNC913` : indefinite-loop-no-guaranteed-checkpoint
194194
Autofix support
195195
===============
196196
The following rules support :ref:`autofixing <autofix>`.
197+
197198
- :ref:`ASYNC100 <ASYNC100>`
198199
- :ref:`ASYNC910 <ASYNC910>`
199200
- :ref:`ASYNC911 <ASYNC911>`

docs/usage.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ Configuration
9898
`You can configure flake8 with command-line options <https://flake8.pycqa.org/en/latest/user/invocation.html>`_,
9999
but we prefer using a config file. See general documentation for `configuring flake8 <https://flake8.pycqa.org/en/latest/user/configuration.html>`_ which also handles options registered by plugins such as ``flake8-async``.
100100

101-
If you want to use a ``pyproject.toml`` file for configuring flake8 we recommend `pyproject-flake8 <https://github.com/csachs/pyproject-flake8>` or similar.
101+
If you want to use a ``pyproject.toml`` file for configuring flake8 we recommend `pyproject-flake8 <https://github.com/csachs/pyproject-flake8>`_ or similar.
102102

103-
Note that when running ``flake8-async`` as a standalone it's not currently possible to use a configuration file. Consider using some wrapper that lets you specify command-line flags in a file. For example, :ref:`install-run-pre-commit`, `tox <https://tox.wiki>`, `hatch scripts <https://hatch.pypa.io/1.9/environment/#scripts>`, MakeFiles, etc.
103+
Note that when running ``flake8-async`` as a standalone it's not currently possible to use a configuration file. Consider using some wrapper that lets you specify command-line flags in a file. For example, :ref:`install-run-pre-commit`, `tox <https://tox.wiki>`_, `hatch scripts <https://hatch.pypa.io/1.9/environment/#scripts>`_, MakeFiles, etc.
104104

105105
Selecting rules
106106
===============

0 commit comments

Comments
 (0)