Commit Graph

19802 Commits

Author SHA1 Message Date
danieleades
2759c2c76b
Use `any` to find elements in iterable (#11053) 2023-01-02 04:52:46 +00:00
Harrissou Sant-anna
da6a20d50b
Fix typos in usage/configuration.rst (#10834) 2023-01-02 04:48:53 +00:00
Adam Turner
4032070e81
Run pyupgrade (#11070) 2023-01-02 00:01:14 +00:00
Rotzbua
ede68fa423
Remove obsolete HTML keyword `link rel="shortcut"` (#11069)
The link relationship keyword `shortcut` does not appear in the HTML 5 specification [1].

It was used by historic browsers (i.e. Internet Explorer 6) which Sphinx no longer supports.

[1]: HTML5 Specification, 4.6.7.8 Link type "icon", https://html.spec.whatwg.org/#rel-icon
2023-01-01 22:18:13 +00:00
Frazer McLean
5841080319
Clarify licence in Sphinx's metadata (#10956)
Disambiguate which BSD license is used in a computer-parsable form.
2023-01-01 22:12:55 +00:00
Adam Turner
14a9289d78 Use PEP 604 types 2023-01-01 20:48:39 +00:00
Adam Turner
26f79b0d2d Use PEP 595 types 2023-01-01 20:48:38 +00:00
Adam Turner
f4c8a0a68e Insert `from __future__ import annotations` 2023-01-01 20:48:37 +00:00
Adam Turner
0b1efd7756 Add Pygments version to sphinx --bug-report 2023-01-01 19:45:40 +00:00
Adam Turner
f8e8584ea5 Update GitHub bug report template 2023-01-01 19:44:35 +00:00
Adam Turner
a1c10f5d5e Happy New Year! 2023-01-01 19:40:01 +00:00
Adam Turner
a6257fc83b Make copyright text inclusion test date-independent
Improve clarity on what the test is looking for in the footer
2023-01-01 19:38:55 +00:00
Adam Turner
1e900a26e8 Merge branch '6.0.x' 2023-01-01 19:17:24 +00:00
Adam Turner
965768bfda Fix tests for Pygments 2.14
Pygments 2.14 was released on 01/01/2023 [0]

[0]: https://pygments.org/docs/changelog/#version-2-14-0
2023-01-01 19:17:03 +00:00
danieleades
bd71d6e85a
Add the `SIM300` lint (#11058)
``SIM300`` is 'yoda conditions' [0]. These have already been fixed in
this repo, but we might as well add the lint to prevent them being
inadvertently re-added.

[0]: https://github.com/MartinThoma/flake8-simplify#SIM300
2023-01-01 17:59:23 +00:00
danieleades
124bbce049
Fix `SIM904`, directly construct dicts (#11059) 2023-01-01 17:54:11 +00:00
Adam Turner
ff202240ab Merge branch '6.0.x' 2022-12-31 17:38:32 +00:00
Viktor Haag
5715abf1d4
Update removal note for logo and favicon variables (#11063)
These were removed in Sphinx 6.0.0
2022-12-31 17:38:06 +00:00
Adam Turner
03c6244949 Re-enable CI testing with Python 3.12 alphas
This partially reverts commit 7418d2ccc4
2022-12-30 18:11:52 +00:00
Adam Turner
aeda313430 Reflect changes to `Enum` signature in Python 3.12 2022-12-30 18:11:52 +00:00
John Gardner
28d184c0d6
Add test for multi-word key names (`kbd` role) (#10765) 2022-12-30 00:57:51 +00:00
Adam Turner
bf06d7ef4d
Factor out HTML 4 translator (#11051)
Move the HTML 4 translator into a private module.
2022-12-30 00:53:04 +00:00
textshell
aa2fa38fef
Fix lookup table for multi-word key names (`kbd` role) (#10962)
It seems the original PR adding multi word key support forgot to add
commas and python helpfully just concatenated the strings instead of
building the required tuples.
2022-12-30 00:52:29 +00:00
Adam Turner
b91f6617ed Enable Ruff's pylint 'PLC2201' check
Address all cases where the comparison order check is violated
2022-12-30 00:06:11 +00:00
Adam Turner
2c97bfaa19 Remove redundant import aliases with isort 2022-12-29 23:53:48 +00:00
Adam Turner
5b9736773b Enable Ruff's pyupgrade checks 2022-12-29 23:53:48 +00:00
Adam Turner
3bcf11c30c Enable Ruff's flake8-debugger checks 2022-12-29 23:53:48 +00:00
Adam Turner
7fb45a9058 Enable Ruff's flake8-bandit checks 2022-12-29 23:53:48 +00:00
Adam Turner
b5357774a7 Enable Ruff's pylint checks
Also fix two PLW0602 warnings (``global`` without assignment) and
five PLW0120 warnings (else clause on loop without break).
2022-12-29 23:53:48 +00:00
Adam Turner
b89c33fc0a Enable Ruff's pygrep-hooks checks 2022-12-29 23:53:48 +00:00
danieleades
6a132eba5a
Tighten mypy 'strict optional' whitelist (#11038)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2022-12-29 19:09:17 +00:00
James Addison
bb37309a6d
Remove support for pluralisation during `gettext` resource translation (#10979)
Code related to ``ngettext`` (support for n-ary / plural forms of
translated text) doesn't appear to be used, so this commit cleans up
the code by removing the ``ngettext`` reference.

Detail
------

- ``ngettext`` allows an application to provide a dynamic number
  (often a count of items, like '5' in ``the linter produced 5
  warnings``) to the translation query so that a plurality-relevant
  message can be retrieved from the catalogue.
- ``sphinx`` has previously used this within its own codebase, but no
  longer does -- ``babel`` command-line extraction [1] is used to
  retrieve translatable resources from the codebase, and extraction
  of plural-form keywords is not configured (nor easy to enable, as
  far as I could tell).
- As a result it seems like it may make sense to remove the code.

[1]: https://babel.pocoo.org/en/latest/cmdline.html#extract
2022-12-29 19:08:47 +00:00
Adam Turner
5a46d8d7e1 Check NoQA comments with Ruff
This uses the special 'RUF100' code to check NoQA comments.
https://github.com/charliermarsh/ruff#automating-noqa-directives
2022-12-29 17:05:05 +00:00
Adam Turner
8634fbce60 Adopt the Ruff code linting tool
https://github.com/charliermarsh/ruff
2022-12-29 17:00:27 +00:00
Adam Turner
f852661243 Allow line breaks before binary operators 2022-12-29 15:55:52 +00:00
Adam Turner
6016b4d634 Break lists in `.flake8` to one item per line 2022-12-29 15:53:37 +00:00
Adam Turner
6b09d193a6 Rename `setup.cfg to .flake8` 2022-12-29 15:44:04 +00:00
Adam Turner
30a9067a34 Bump version 2022-12-29 15:14:50 +00:00
Adam Turner
5b56a231af Bump to 6.0.0 final 2022-12-29 14:59:17 +00:00
Adam Turner
f1d1e9c997 Update coverage workflow for Tox 4 2022-12-29 14:50:24 +00:00
Adam Turner
66a738c2bf Update coverage workflow for new configuration location 2022-12-29 14:28:58 +00:00
James Addison
041e5f8268
Add test coverage for 'today_fmt' reference substitution (#10980) 2022-12-29 14:19:43 +00:00
Antony Lee
da25145d08
Remove unnecessary conditional import in `sphinx.ext.napoleon` (#11043)
The conditional import could have been useful for the external
sphinxcontrib.napoleon (to keep backcompat with older versions of
sphinx), but seems just confusing for a builtin extension.
2022-12-29 14:11:11 +00:00
Sergey B Kirpichev
45a0ea9fc9
Migrate coveragepy config into pyproject.toml (#11025)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-12-29 14:09:56 +00:00
Tim Hoffmann
3ec54f1183
Create a `pydata_sphinx_theme` section in usage examples (#11046) 2022-12-29 13:59:34 +00:00
mikemckiernan
32bce8fb7c
Copy edit the tutorial (#11049)
- Correct two typos.
- Include the ingredient index in the "for example"
  statement. It's tedious, but the audience is reading
  to learn.
2022-12-29 13:58:32 +00:00
Martin Liška
9844162473
Fix example using `add_config_value` (#10937)
``add_config_value()`` has mandatory 3 arguments.
2022-12-20 13:15:00 +00:00
Martin Liška
bf4a626826
RTD builder: add graphviz depedendency (#11040) 2022-12-20 12:30:59 +00:00
Hugo van Kemenade
644043c317 Remove redundant instructions from PR template 2022-12-16 16:56:43 +01:00
Daniel Eades
841c0cecb3 check for blanket noqas in CI 2022-12-16 16:50:24 +01:00