Skip to content

Commit f5d2bda

Browse files
authored
Replace doc8 with sphinx-lint (#16431)
1 parent d5c0db7 commit f5d2bda

File tree

9 files changed

+137
-74
lines changed

9 files changed

+137
-74
lines changed

bin/lint

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ find . -name '*.py' -exec python -m pyupgrade --py312-plus {} +
1515
python -m flake8 .
1616
python -m black --check --diff *.py warehouse/ tests/
1717
python -m isort --check *.py warehouse/ tests/
18-
python -m doc8 --allow-long-titles README.rst CONTRIBUTING.rst docs/ --ignore-path "docs/**/_build/"
18+
sphinx-lint --enable=all --disable=line-too-long README.rst CONTRIBUTING.rst docs/dev/ --ignore=docs/dev/_build/
1919
python -m curlylint ./warehouse/templates ./docs/blog
2020
python -m mypy -p warehouse
2121
./bin/flushes

docs/dev/api-reference/xml-rpc.rst

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ Changes to XMLRPC API
4949
incident <https://status.python.org/incidents/grk0k7sz6zkp>`_.
5050

5151
- ``package_releases`` As Warehouse does not support the concept of hidden
52-
releases, the `show_hidden` flag now controls whether the latest version or
52+
releases, the ``show_hidden`` flag now controls whether the latest version or
5353
all versions are returned.
5454

55-
- ``release_data`` The `stable_version` flag is always an empty string. It was
55+
- ``release_data`` The ``stable_version`` flag is always an empty string. It was
5656
never fully supported anyway.
5757

5858
- ``release_downloads`` and ``top_packages`` No longer supported. Use
@@ -81,7 +81,7 @@ Retrieve the last event's serial id (an ``int``).
8181
``changelog_since_serial(since_serial)``
8282
++++++++++++++++++++++++++++++++++++++++
8383

84-
Retrieve a list of `(name, version, timestamp, action, serial)` since the
84+
Retrieve a list of ``(name, version, timestamp, action, serial)`` since the
8585
event identified by the given ``since_serial``. All timestamps are UTC
8686
values.
8787

@@ -98,20 +98,20 @@ Package querying
9898
``package_roles(package_name)``
9999
+++++++++++++++++++++++++++++++
100100

101-
Retrieve a list of `[role, user]` for a given `package_name`.
102-
Role is either `Maintainer` or `Owner`.
101+
Retrieve a list of ``[role, user]`` for a given ``package_name``.
102+
Role is either ``Maintainer`` or ``Owner``.
103103

104104
``user_packages(user)``
105105
+++++++++++++++++++++++
106106

107-
Retrieve a list of `[role, package_name]` for a given `user`.
108-
Role is either `Maintainer` or `Owner`.
107+
Retrieve a list of ``[role, package_name]`` for a given ``user``.
108+
Role is either ``Maintainer`` or ``Owner``.
109109

110110
``browse(classifiers)``
111111
+++++++++++++++++++++++
112112

113-
Retrieve a list of `[name, version]` of all releases classified with all of
114-
the given classifiers. `classifiers` must be a list of Trove classifier
113+
Retrieve a list of ``[name, version]`` of all releases classified with all of
114+
the given classifiers. ``classifiers`` must be a list of Trove classifier
115115
strings.
116116

117117
``updated_releases(since)``
@@ -143,10 +143,10 @@ Returns a list of name strings.
143143
.. warning::
144144
Migrate to using the :doc:`json`.
145145

146-
Retrieve a list of the releases registered for the given `package_name`,
146+
Retrieve a list of the releases registered for the given ``package_name``,
147147
ordered by version.
148148

149-
If `show_hidden` is `False` (the default), only the latest version is
149+
If ``show_hidden`` is ``False`` (the default), only the latest version is
150150
returned. Otherwise, all versions are returned.
151151

152152
``release_urls(package_name, release_version)``
@@ -155,7 +155,7 @@ returned. Otherwise, all versions are returned.
155155
.. warning::
156156
Migrate to using the :doc:`json`.
157157

158-
Retrieve a list of download URLs for the given `release_version`.
158+
Retrieve a list of download URLs for the given ``release_version``.
159159
Returns a list of dicts with the following keys:
160160

161161
* filename
@@ -176,7 +176,7 @@ Returns a list of dicts with the following keys:
176176
.. warning::
177177
Migrate to using the :doc:`json`.
178178

179-
Retrieve metadata describing a specific `release_version`.
179+
Retrieve metadata describing a specific ``release_version``.
180180
Returns a dict with keys for:
181181

182182
* name
@@ -219,7 +219,7 @@ Deprecated Methods
219219

220220
.. warning::
221221
The following methods are permanently deprecated and will return a
222-
`RuntimeError`
222+
``RuntimeError``
223223

224224
``changelog(since, with_ids=False)``
225225
++++++++++++++++++++++++++++++++++++

docs/dev/development/email.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Calling a function with the ``_email`` decorator does the following:
4040
response
4141
- A security log is added to the user's account
4242
- The email is sent using Amazon SES (on production environment)
43-
- A metric is sent to Datadog named `warehouse.emails.scheduled` with the tags
43+
- A metric is sent to Datadog named ``warehouse.emails.scheduled`` with the tags
4444
``template_name``, ``allow_unverified``, and ``repeat_window``.
4545

4646
.. _testing-e-mails:

docs/dev/development/getting-started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ application.
188188
(on Windows by editing the config file found at ``C:\Users\<USER>\AppData\Local\Docker\wsl``).
189189

190190
If you are using Linux, you may need to configure the maximum map count to get
191-
the `opensearch` up and running. According to the
191+
the ``opensearch`` up and running. According to the
192192
`documentation <https://opensearch.org/docs/2.15/install-and-configure/install-opensearch/index/#important-settings>`_
193193
this can be set temporarily:
194194

@@ -369,7 +369,7 @@ They also have the following Recovery Codes generated:
369369
Using different accounts will allow you to see different parts of the site,
370370
and have slightly different experiences.
371371

372-
For example, using `miketheman` will require email verification.
372+
For example, using ``miketheman`` will require email verification.
373373
See :ref:`testing-e-mails` for more information on how to see those emails.
374374

375375
Logging in as users without 2FA

docs/dev/development/legacy-application-structure.rst

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -40,39 +40,39 @@ The :action parameters are typically submitted through GET URL parameters,
4040
though some actions are also POST actions.
4141

4242
**could be nuked without fuss**
43-
- `display` was used to display a package version but was replaced ages ago
43+
- ``display`` was used to display a package version but was replaced ages ago
4444
by the /<package>/<version> URL structure
45-
- all the user-based stuff like `register_form`, `user`, `user_form`,
46-
`forgotten_password_form`, `login`, `logout`, `forgotten_password`,
47-
`password_reset`, `pw_reset` and `pw_reset_change` will most likely be
45+
- all the user-based stuff like ``register_form``, ``user``, ``user_form``,
46+
``forgotten_password_form``, ``login``, ``logout``, ``forgotten_password``,
47+
``password_reset``, ``pw_reset`` and ``pw_reset_change`` will most likely be
4848
replaced by newer mechanisms in warehouse
49-
- `openid_endpoint`, `openid_decide_post` could also be replaced by something
49+
- ``openid_endpoint``, ``openid_decide_post`` could also be replaced by something
5050
else.
51-
- `home` is the old home page thing and completely unnecessary
52-
- `index` is overwhelming given the number of projects now.
53-
- `browse` and `search` are *probably* only referenced by internal links so
51+
- ``home`` is the old home page thing and completely unnecessary
52+
- ``index`` is overwhelming given the number of projects now.
53+
- ``browse`` and ``search`` are *probably* only referenced by internal links so
5454
should be safe to nuke
55-
- `submit_pkg_info` and `display_pkginfo` probably aren't used
56-
- `submit_form` and `pkg_edit` will be changing anyway
57-
- `files`, `urls`, `role`, `role_form` are old style and will be changing
58-
- `list_classifiers` .. this might actually only be used by Richard :)
59-
- `claim`, `openid`, `openid_return`, `dropid` are legacy openid login
55+
- ``submit_pkg_info`` and ``display_pkginfo`` probably aren't used
56+
- ``submit_form`` and ``pkg_edit`` will be changing anyway
57+
- ``files``, ``urls``, ``role``, ``role_form`` are old style and will be changing
58+
- ``list_classifiers`` .. this might actually only be used by Richard :)
59+
- ``claim``, ``openid``, ``openid_return``, ``dropid`` are legacy openid login
6060
support and will be changing
61-
- `clear_auth` "clears" Basic Auth
62-
- `addkey`, `delkey` will be changing if we even keep supporting ssh submit
63-
- `verify` probably isn't actually used by anyone
64-
- `lasthour` is a pubsubhubbub thing - does this even exist any longer?
65-
- `json` is never used as a :action invocation, only ever /<package>/json
66-
- `gae_file` I'm pretty sure this is not necessary
67-
- `rss_regen` manually regens the RSS cached files, not needed
68-
- `about` No longer needed.
69-
- `delete_user` No longer needed.
70-
- `exception` No longer needed.
61+
- ``clear_auth`` "clears" Basic Auth
62+
- ``addkey``, ``delkey`` will be changing if we even keep supporting ssh submit
63+
- ``verify`` probably isn't actually used by anyone
64+
- ``lasthour`` is a pubsubhubbub thing - does this even exist any longer?
65+
- ``json`` is never used as a :action invocation, only ever /<package>/json
66+
- ``gae_file`` I'm pretty sure this is not necessary
67+
- ``rss_regen`` manually regens the RSS cached files, not needed
68+
- ``about`` No longer needed.
69+
- ``delete_user`` No longer needed.
70+
- ``exception`` No longer needed.
7171

7272
**will need to retain**
73-
- `rss` and `packages_rss` will be in a bunch of peoples` RSS readers
74-
- `doap` is most likely referred to
75-
- `show_md5` ?
73+
- ``rss`` and ``packages_rss`` will be in a bunch of peoples` RSS readers
74+
- ``doap`` is most likely referred to
75+
- ``show_md5`` ?
7676

7777
**can be deprecated carefully**
78-
- `submit`, `upload`, `doc_upload`, `file_upload`,
78+
- ``submit``, ``upload``, ``doc_upload``, ``file_upload``,

docs/dev/development/submitting-patches.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Documentation
6161
-------------
6262

6363
Important information should be documented with prose in the ``docs`` section.
64-
To ensure it builds and passes `doc8`_ style checks you can run
64+
To ensure it builds and passes documentation style checks you can run
6565
``make dev-docs user-docs`` and ``make lint`` respectively.
6666

6767

@@ -187,6 +187,5 @@ feature branch at least once while you are working on it.
187187
.. _`Write comments as complete sentences.`: https://nedbatchelder.com/blog/201401/comments_should_be_sentences.html
188188
.. _`syntax`: https://sphinx-doc.org/domains.html#info-field-lists
189189
.. _`Studies have shown`: https://static1.smartbear.co/support/media/resources/cc/book/code-review-cisco-case-study.pdf
190-
.. _`doc8`: https://github.com/PyCQA/doc8
191190
.. _`coverage.py`: https://pypi.org/project/coverage
192191
.. _`the Black Code Style`: https://github.com/psf/black#the-black-code-style

docs/dev/development/token-scanning.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ the request at the bottom. If all went well, you should see a ``204`` ('No
6767
Content').
6868

6969
Whether it worked or not, a bunch of metrics have been issued, you can see them
70-
in the `notdatadog` container log.
70+
in the ``notdatadog`` container log.
7171

7272
GitLab Secret Detection
7373
-----------------------

requirements/lint.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
doc8>=1.1.0
21
flake8
32
curlylint
43
pep8-naming
@@ -9,6 +8,7 @@ mypy
98
celery-types
109
msgpack-types
1110
mypy-zope
11+
sphinx-lint
1212
types-babel
1313
types-boto3
1414
types-certifi

0 commit comments

Comments
 (0)