Commit Graph
100 Commits
Author SHA1 Message Date
9257a4f1bb Improve type annotations with an 'extract_node' test utility (#14151)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-15 18:40:34 +00:00
7926051f69 Recommend `uv` for local development (#14148)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-12-03 22:06:09 +00:00
c043841398 Shrink mypy whitelist for `tests.test_transforms.test_transforms_post_transforms` (#14141)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-02 12:10:20 +00:00
danieleadesanddaniel.eades ded587ebc6 Shrink mypy whitelist for `tests.test_directives.test_directive_patch` (#14139)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
2025-12-01 11:54:20 +00:00
a03556feb4 Shrink mypy whitelist for `tests.test_builders.test_build_latex` (#14138)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-12-01 10:58:51 +00:00
danieleades 05679efe7b Type-check the 'autodoc_intenum' example (#12827) 2024-10-12 01:14:56 +01:00
cf8f140dd8 Shrink mypy whitelist (#12900)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-05 21:37:05 +01:00
danieleadesandAdam Turner 7546545876 Further improve typing in tests/ (#12816)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-10-03 20:17:40 +01:00
danieleades bb2c4e9bac Simplify mypy settings (#12823) 2024-08-31 08:13:11 +01:00
danieleades 53f8edfba4 lint: typecheck docs/conf.py (#12697) 2024-08-26 11:33:34 +02:00
danieleades 49bf65fc18 Add type stubs for defusedxml (#12667) 2024-07-23 23:56:43 +01:00
danieleadesandAdam Turner f09bc62969 Shrink mypy exclude list (#12669)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-23 22:19:15 +01:00
danieleades 2f9a79c3b2 Disallow implicit re-export (#12653) 2024-07-23 02:38:45 +01:00
danieleadesandAdam Turner 58d4224227 Disallow untyped calls (#12640)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-23 02:22:58 +01:00
danieleades e8f8247e0c Disallow subclassing `Any` (#12638) 2024-07-23 01:52:20 +01:00
danieleadesandAdam Turner f8e9669f8b Disallow untyped definitions (#12637)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-23 01:42:53 +01:00
danieleadesandDaniel Eades 952bdbbac2 Shrink mypy whitelist for `sphinx.cmd.quickstart` (#12617)
Co-authored-by: Daniel Eades <daniel.eades@seebyte.com>
2024-07-20 20:05:48 +01:00
danieleades 46fc784758 Shrink mypy whitelist for `sphinx.ext.autosummary.generate` (#12604) 2024-07-20 20:04:36 +01:00
danieleades 4808041cc9 Shrink mypy whitelist for `sphinx.ext.autodoc.directive` (#12602) 2024-07-20 20:03:50 +01:00
danieleadesandDaniel Eades 20507af3d7 Add missing type stubs (#12619)
Co-authored-by: Daniel Eades <daniel.eades@seebyte.com>
2024-07-20 19:54:49 +01:00
danieleadesandAdam Turner d5df528e8c Shrink the mypy whitelist for `sphinx.util.display` (#12570)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-15 05:34:43 +01:00
danieleadesandAdam Turner f4bb9ca112 Shrink the mypy whitelist: `sphinx.application` (#12568)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-07-15 03:04:10 +01:00
danieleades 082f13f378 Pin the version of 'docutils-types' (#12515) 2024-07-07 17:27:59 +01:00
danieleadesandAdam Turner 6d6feb240f Use Ruff's `extend-exclude` (#11901)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-04-24 19:00:00 +01:00
22cee42094 [lint] use `types-docutils instead of docutils-stubs for docutils` type annotations (#12012)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-23 21:09:18 +01:00
6c92c5c0f3 [lint] bump ruff version (#12170)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-22 10:33:42 +01:00
danieleades 4f7318767c [lint] extend FURB lints (#12088) 2024-03-17 12:06:39 +01:00
danieleadesanddaniel.eades 768cf5e7ac [lint] run mypy on the utils/ directory (#12090)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
2024-03-15 10:31:32 +01:00
23dd754f63 [lint] ruff simplify config (#12086)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 12:33:17 +01:00
d6f49f9c09 [lint] simplify lint config for flake8-annotations (#12073)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 11:37:15 +01:00
92380e60d1 [lint] add RUFF005 lint (#12068)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 11:26:30 +01:00
d4c739cdd1 [lint] add PERF401 lint (#12070)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 11:16:36 +01:00
fb91cb3f43 [lint] add FURB105 lint (#12069)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 11:05:40 +01:00
d74a450213 [deps] bump ruff version (#12065)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 10:42:55 +01:00
12d523efdc [deps] bump mypy version (#12066)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-03-14 10:06:27 +01:00
danieleades 3190c3fcf1 [github] update dependabot config (#12071) 2024-03-14 09:55:07 +01:00
danieleades bea8b6bf4d [internals] improve type safety when using `NodeMatcher` (#12034) 2024-03-02 16:34:54 +01:00
d6f38ade54 [CI] update mypy CI job to use local config (#12013)
Co-authored-by: daniel.eades <daniel.eades@seebyte.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-02-26 12:15:17 +01:00
danieleadesandBénédikt Tran adde256893 [lint] shrink mypy whitelist (#11898)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-02-26 09:45:19 +01:00
danieleadesandAdam Turner f9c8943889 Use `# NoQA` consistently (#11903)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-21 20:20:58 +00:00
danieleadesandAdam Turner f7fbfaa471 Enable various pydocstyle (D) rules (#11878)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2024-01-14 21:13:46 +00:00
danieleades e1bbe88eb5 Fix some type errors in the C and C++ domains (#11791) 2023-12-29 09:56:49 +00:00
danieleadesandAdam Turner f7f4fb42b0 Enable more entire categories in Ruff (#11816)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-12-29 09:55:28 +00:00
danieleadesandAdam Turner 64e7ba5e3f Enable the entire pycodestyle category (#11820)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-12-28 06:41:32 +00:00
danieleades ab70ef73a8 Move the SIM115 whitelist inline (#11819) 2023-12-27 00:21:11 +00:00
danieleadesandAdam Turner 4de540efb6 Enable mypy 'strict optional' for 19 modules (#11422)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 21:29:04 +01:00
danieleadesandAdam Turner d564a8ba11 shrink mypy whitelist for `sphinx.builders` (#11396)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 18:21:29 +01:00
danieleadesanddaniel.eades edd9ea0a39 shrink whitelist for `sphinx.ext.autodoc.type_comment` (#11400)
Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
2023-07-23 17:49:18 +01:00
danieleadesandAdam Turner f06ef37017 shrink mypy whitelist for `sphinx.application` (#11395)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-07-23 17:47:01 +01:00
danieleades 554d2eb399 shrink mypy whitelist for `sphinx.environment.adapters.indexentries` (#11421) 2023-07-23 17:26:12 +01:00
danieleades 31759d6b08 Expand the mypy whitelist for 'sphinx.util' (#11406) 2023-05-12 23:51:59 +01:00
danieleades 1c5158e010 Remove 'sphinx.ext.duration' from the mypy whitelist (#11404) 2023-05-12 23:50:44 +01:00
danieleades 2c58722627 Remove 'sphinx.util.typing' from mypy whitelist (#11397) 2023-05-12 23:48:07 +01:00
danieleadesanddaniel.eades 2f03886d55 Remove deprecated code in `sphinx.builders.linkcheck` (#11089)
Co-authored-by: daniel.eades <daniel.eades@hotmail.com>
2023-03-17 15:24:38 +00:00
danieleades c499f66012 Add SIM113 lint (#11057)
SIM113: Use ``enumerate``
2023-01-05 11:45:29 +00:00
danieleadesandAdam Turner f89f94354e Remove flake8 plugins in favour of Ruff (#11085)
Remove flake8-comprehensions and flake8-bugbear in favour of Ruff.

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-01-05 11:40:52 +00:00
danieleades 04791156db Suppress lint failures from Ruff 0.0.211 (#11086)
Ruff has added new SIM lints which sphinx has not implemented.

This suppresses those lints (matching the flake8-simplify config).
2023-01-05 11:38:29 +00:00
danieleadesandAdam Turner 94e6e3917f De-glob mypy whitelist for 'sphinx.domains.*' (#11064)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-01-02 18:32:44 +00:00
danieleades 256e521807 Shrink mypy whitelist for 'util.nodes' module (#11061) 2023-01-02 17:55:53 +00:00
danieleadesandAdam Turner cc8f697a9b Address SIM103 lints (#11052)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-01-02 09:21:32 +00:00
danieleadesandAdam Turner dbf36f8b37 Shrink 'any-generics' whitelist for 'writers' module (#10867)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2023-01-02 05:29:46 +00:00
danieleades c2e278520e Add SIM905 lint (#11055)
This lints for use of a list of strings instead of splitting a constant string on whitespace
2023-01-02 05:02:42 +00:00
danieleades 2759c2c76b Use `any` to find elements in iterable (#11053) 2023-01-02 04:52:46 +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
danieleadesandAdam Turner 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
Daniel Eades 841c0cecb3 check for blanket noqas in CI 2022-12-16 16:50:24 +01:00
Daniel Eades 1abb24e309 remove blanket 'noqas' 2022-12-16 16:50:24 +01:00
danieleades bf36a7905a shrink 'any-generics' whitelist for the 'deprecation' module (#10849) 2022-09-29 23:47:58 +01:00
danieleades 6e113d4e90 Use a module level constant as best practice (#10876) 2022-09-29 19:07:29 +01:00
danieleades 3c73efadab shrink 'Any generics' mypy whitelist for builders module (#10846) 2022-09-29 17:26:53 +01:00
danieleades 8267dc4fde shrink 'any-generics' whitelist for the 'locale' module (#10866) 2022-09-29 17:16:36 +01:00
danieleades 6dbb618834 Shrink 'any-generics' whitelist for the pycode module (#10868) 2022-09-28 09:13:48 +01:00
danieleades 05683f794c Shrink 'any-generics' whitelist for the cmd module (#10847) 2022-09-27 17:56:35 +01:00
danieleades b842cabd4f Add a new mypy whitelist for 'Any generics' (#10845) 2022-09-24 15:12:01 +01:00
danieleades 9b65adc50c Shrink strict optional whitelist (HTML writers) (#10838) 2022-09-20 22:26:39 +01:00
danieleades 276f430b57 Begin addding flake8-simplify checks (#10820)
Start with SIM104 and ignore all other flake8-simplify warnings
2022-09-20 21:30:31 +01:00
danieleades fe2f96ac99 Shink the strict optional whitelist (#10800)
Removes `sphinx.search`
2022-09-09 07:29:54 +01:00
danieleades c5ae5855ae Remove sphinx.builders.gettext module from whitelist (#10798) 2022-09-09 02:35:59 +01:00
danieleades 5e9550c78e Fix more strict static typing errors (#10681) 2022-08-28 21:17:14 +01:00
danieleades 12bff8a273 Remove unneeded noqa lint suppression comments (#10772) 2022-08-28 20:03:17 +01:00
danieleadesandAdam Turner 2b02173617 Further improve type annotations, reduce mypy whitelist (#10770)
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2022-08-28 19:50:01 +01:00
danieleades c3d8a7d50b Fix some static typing errors (#10745) 2022-08-14 15:27:16 +01:00
daniel.eades 964fcb2e07 Fix flake8 5.0.0 reported formatting errors 2022-08-01 20:55:47 +02:00
daniel.eades 63edba0388 set up mypy for incremental adoption of 'strict optional' 2022-07-26 08:32:20 +01:00
danieleades a504ac6100 Improve static typing strictness (#10569) 2022-07-18 22:08:16 +01:00
danieleadesandAdam Turner 25d379fb53 Lint with flake8-bugbear (#10602)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2022-07-12 22:55:57 +01:00
danieleades 13fb17468e Remove redundant static typing casts (#10612) 2022-07-02 11:04:31 +01:00
danieleades 12e86ff0e1 Use the flake8-comprehensions lint plugin (#10601) 2022-06-26 14:43:05 +01:00
Daniel Eades 4e4813099b remove unnecessary generators (C400, C401) 2022-06-03 13:15:44 +01:00
Daniel Eades 89210fc275 remove unnecessary list comprehension (C416) 2022-06-03 13:15:43 +01:00
Daniel Eades 55a0143df7 remove unnecessary list calls around 'sorted' (C413) 2022-06-03 13:15:42 +01:00
Daniel Eades 9e051dfb34 remove unnecessary list calls within 'sorted' (C414) 2022-06-03 13:15:35 +01:00
Daniel Eades 0bf661857d simplify dict key checks (SIM118) 2022-06-03 13:15:23 +01:00
danieleades 9c68cd12d7 Update recipe.py 2022-01-14 08:58:54 +00:00
danieleadesandTakeshi KOMIYA 18d7dfbd95 Update tests/test_ext_napoleon.py
Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
2022-01-14 08:58:02 +00:00
danieleadesandTakeshi KOMIYA 99f905b8b4 Update sphinx/writers/texinfo.py
Co-authored-by: Takeshi KOMIYA <i.tkomiya@gmail.com>
2022-01-14 08:57:56 +00:00
Daniel Eades 6697ed62ed address some unused loop control variables (B007) 2022-01-12 20:19:18 +00:00
Daniel Eades e51591d061 simplify some set comparisons (SIM109) 2022-01-10 19:56:30 +00:00
Daniel Eades 574e787bf1 use class-style syntax for 'NamedTuple's 2022-01-10 15:35:27 +00:00