Skip to content

Comments

Apply ruff formatting to mdtests#22935

Merged
amyreese merged 4 commits intomainfrom
amy/ruffen-mdtests-mapped
Feb 13, 2026
Merged

Apply ruff formatting to mdtests#22935
amyreese merged 4 commits intomainfrom
amy/ruffen-mdtests-mapped

Conversation

@amyreese
Copy link
Member

@amyreese amyreese commented Jan 29, 2026

  • Updated the prek hook to replace blacken-docs with running ruff from local checkout.
  • Added some formatting directives to preserve obvious intentional formatting choices
  • Formatted md tests and updated snapshots

@amyreese amyreese changed the base branch from main to amy/ruffen-docs-extension January 29, 2026 01:01
@amyreese
Copy link
Member Author

@AlexWaygood this alternate form of #22932 but with extension mapping enabled from #22934 configured, covering the three code block languages I found in mdtests. It's a much smaller diff, but does result in class methods dropping their spacing between them.

@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 29, 2026

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@AlexWaygood
Copy link
Member

@AlexWaygood this alternate form of #22932 but with extension mapping enabled from #22934 configured, covering the three code block languages I found in mdtests. It's a much smaller diff, but does result in class methods dropping their spacing between them.

I'd be very happy indeed with this formatting! I don't mind too much the spaces going away, -- to me, this diff:

  class Foo:
      @property
      def foo(self): ...
-
      @property
      def bar(self): ...
-
      @property
      def baz(self): ...

is much less annoying than this diff, which we see lots of in the other PR 😄

  class Foo: ...
+
+
  class Bar: ...
+
+
  class Baz: ...

@amyreese amyreese force-pushed the amy/ruffen-docs-extension branch from 35ed3d0 to 3eebdf9 Compare January 29, 2026 21:27
@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 9bcba89 to 0796bbf Compare January 29, 2026 22:07
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 29, 2026

Typing conformance results

No changes detected ✅

@amyreese
Copy link
Member Author

Looks like this will also be dependent on getting a solution for #22637, and either supporting the blacken-docs directives or adding a ruff equivalent to a bunch of files.

@amyreese amyreese changed the title Apply ruff formatting to mdtests, with extension mapping Apply ruff formatting to mdtests Jan 29, 2026
@amyreese amyreese linked an issue Jan 29, 2026 that may be closed by this pull request
@astral-sh-bot
Copy link

astral-sh-bot bot commented Jan 29, 2026

mypy_primer results

Changes were detected when running on open source projects
spack (https://github.com/spack/spack)
- lib/spack/spack/detection/path.py:169:33: error[invalid-argument-type] Argument to function `dedupe_paths` is incorrect: Expected `list[str]`, found `Unknown | list[Unknown | int | str | ... omitted 3 union elements]`
+ lib/spack/spack/detection/path.py:169:33: error[invalid-argument-type] Argument to function `dedupe_paths` is incorrect: Expected `list[str]`, found `Unknown | list[PathLike[str] | PathLike[bytes] | Unknown | ... omitted 3 union elements]`
- lib/spack/spack/verify_libraries.py:164:46: error[invalid-argument-type] Argument to function `candidate_matches` is incorrect: Expected `bytes`, found `Unknown | bytes | str | PathLike[str] | PathLike[bytes]`
+ lib/spack/spack/verify_libraries.py:164:46: error[invalid-argument-type] Argument to function `candidate_matches` is incorrect: Expected `bytes`, found `bytes | Unknown | str | PathLike[str] | PathLike[bytes]`
- lib/spack/spack/verify_libraries.py:165:17: error[invalid-assignment] Invalid subscript assignment with key of type `Unknown | bytes | str | PathLike[str] | PathLike[bytes]` and value of type `Unknown | bytes | str | PathLike[str] | PathLike[bytes]` on object of type `dict[bytes, bytes]`
+ lib/spack/spack/verify_libraries.py:165:17: error[invalid-assignment] Invalid subscript assignment with key of type `bytes | Unknown | str | PathLike[str] | PathLike[bytes]` and value of type `bytes | Unknown | str | PathLike[str] | PathLike[bytes]` on object of type `dict[bytes, bytes]`
- lib/spack/spack/verify_libraries.py:170:57: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[Unknown | bytes | str | PathLike[str] | PathLike[bytes]]`
+ lib/spack/spack/verify_libraries.py:170:57: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[bytes | Unknown | str | PathLike[str] | PathLike[bytes]]`
- lib/spack/spack/verify_libraries.py:170:69: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[Unknown | bytes | str | PathLike[str] | PathLike[bytes]]`
+ lib/spack/spack/verify_libraries.py:170:69: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `list[bytes]`, found `list[bytes | Unknown | str | PathLike[str] | PathLike[bytes]]`

aiortc (https://github.com/aiortc/aiortc)
- src/aiortc/sdp.py:446:52: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `None | Unknown | str`
+ src/aiortc/sdp.py:446:52: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `None | str | Unknown`

porcupine (https://github.com/Akuli/porcupine)
- porcupine/pluginmanager.py:133:49: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | str`
- Found 25 diagnostics
+ Found 24 diagnostics

tornado (https://github.com/tornadoweb/tornado)
- tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _T@next | _VT@next`
+ tornado/gen.py:255:62: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `None | Awaitable[Unknown] | list[Awaitable[Unknown]] | dict[Any, Awaitable[Unknown]] | Future[Unknown]`, found `_T@next | _VT@next | _T@next`

artigraph (https://github.com/artigraph/artigraph)
- tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[Unknown | int | float] | tuple[float | Unknown | int, ...]`
+ tests/arti/types/test_types.py:100:51: error[invalid-argument-type] Argument is incorrect: Expected `frozenset[Any]`, found `frozenset[float | Unknown | int] | list[int | Unknown | float] | tuple[float | Unknown | int, ...]`

meson (https://github.com/mesonbuild/meson)
- mesonbuild/dependencies/cuda.py:137:76: error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `str | None | Unknown`
+ mesonbuild/dependencies/cuda.py:137:76: error[invalid-argument-type] Argument to function `version_compare_many` is incorrect: Expected `str`, found `Unknown | str | None`

openlibrary (https://github.com/internetarchive/openlibrary)
- openlibrary/catalog/utils/__init__.py:132:17: error[unresolved-attribute] Attribute `search` is not defined on `str` in union `str | Unknown`
+ openlibrary/catalog/utils/__init__.py:132:17: error[unresolved-attribute] Attribute `search` is not defined on `str` in union `Unknown | str`

cloud-init (https://github.com/canonical/cloud-init)
- tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/distros/test_user_data_normalize.py:24:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`
- tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | dict[Unknown | str, Unknown | str] | str | ... omitted 3 union elements`
+ tests/unittests/sources/test_gce.py:71:31: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `dict[Unknown, Unknown]`, found `Unknown | bool | list[Unknown] | ... omitted 3 union elements`

prefect (https://github.com/PrefectHQ/prefect)
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `str | list[str] | None`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `bool | None`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `str | list[str] | None`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str] | list[str] | None`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:27:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str | bool | dict[Unknown | str, Unknown | int] | None`
+ src/integrations/prefect-docker/tests/test_containers.py:42:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_containers.py:55:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_containers.py:68:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_containers.py:81:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `DockerHost | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `DockerRegistryCredentials | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:16:44: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:21:16: error[unresolved-attribute] Attribute `id` is not defined on `list[Unknown]` in union `Unknown | list[Unknown]`
+ src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected `DockerRegistryCredentials | None`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:29:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:31:16: error[unresolved-attribute] Attribute `id` is not defined on `list[Unknown]` in union `Unknown | list[Unknown]`
+ src/integrations/prefect-docker/tests/test_images.py:51:17: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:51:17: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-docker/tests/test_images.py:53:16: error[unresolved-attribute] Attribute `id` is not defined on `list[Unknown]` in union `Unknown | list[Unknown]`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `str | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `DockerRegistryCredentials | None`, found `str | bool`
+ src/integrations/prefect-docker/tests/test_images.py:64:47: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str | bool`
+ src/integrations/prefect-kubernetes/prefect_kubernetes/jobs.py:428:17: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `str`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:20:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `None`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:29:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `None`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:38:13: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `None`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:57:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:103:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:149:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:195:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:240:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:286:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_custom_objects.py:344:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:18:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:38:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:70:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:92:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:113:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_deployments.py:141:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:36:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:52:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:68:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:87:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:107:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:131:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_jobs.py:159:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:29:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:46:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:78:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:96:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:115:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:137:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
+ src/integrations/prefect-kubernetes/tests/test_pods.py:167:9: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, Any]`, found `Literal["test"]`
- src/prefect/cache_policies.py:311:25: error[unresolved-attribute] Attribute `__code__` is not defined on `((...) -> Any) & ((*args: object, **kwargs: object) -> object)` in union `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/cache_policies.py:311:25: error[unresolved-attribute] Attribute `__code__` is not defined on `(...) -> Any` in union `Unknown | ((...) -> Any)`
- src/prefect/input/run_input.py:672:20: error[invalid-return-type] Return type does not match returned value: expected `T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler]`, found `Unknown | Coroutine[Any, Any, Unknown]`
+ src/prefect/input/run_input.py:672:20: error[invalid-return-type] Return type does not match returned value: expected `T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler]`, found `T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler] | Coroutine[Any, Any, T@GetAutomaticInputHandler | AutomaticRunInput[T@GetAutomaticInputHandler]]`
+ src/prefect/task_engine.py:1642:28: error[invalid-await] `Unknown | R@AsyncTaskRunEngine | Coroutine[Any, Any, R@AsyncTaskRunEngine]` is not awaitable
+ src/prefect/task_engine.py:1750:47: error[invalid-argument-type] Argument to function `next` is incorrect: Expected `SupportsNext[Unknown]`, found `Unknown | R@run_generator_task_sync`
+ src/prefect/task_engine.py:1763:25: error[unresolved-attribute] Attribute `throw` is not defined on `R@run_generator_task_sync` in union `Unknown | R@run_generator_task_sync`
+ src/prefect/task_engine.py:1809:48: error[unresolved-attribute] Attribute `__anext__` is not defined on `R@run_generator_task_async` in union `Unknown | R@run_generator_task_async`
+ src/prefect/task_engine.py:1821:29: error[unresolved-attribute] Attribute `throw` is not defined on `R@run_generator_task_async` in union `Unknown | R@run_generator_task_async`
- src/prefect/tasks.py:185:9: error[unresolved-attribute] Attribute `__code__` is not defined on `((...) -> Any) & ((*args: object, **kwargs: object) -> object)` in union `Unknown | (((...) -> Any) & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/tasks.py:185:9: error[unresolved-attribute] Attribute `__code__` is not defined on `(...) -> Any` in union `Unknown | ((...) -> Any)`
- src/prefect/tasks.py:795:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> str) | TaskRunNameCallbackWithParameters | str | None`, found `((() -> str) & ~<class 'NotSet'>) | TaskRunNameCallbackWithParameters | str | ... omitted 4 union elements`
+ src/prefect/tasks.py:795:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `(() -> str) | TaskRunNameCallbackWithParameters | str | None`, found `(() -> str) | TaskRunNameCallbackWithParameters | str | ... omitted 3 union elements`
- src/prefect/utilities/_engine.py:64:13: error[invalid-argument-type] Argument to bound method `is_callback_with_parameters` is incorrect: Expected `(...) -> str`, found `(Unknown & Top[(...) -> object]) | (str & Top[(...) -> object]) | ((() -> str) & ((*args: object, **kwargs: object) -> object)) | (TaskRunNameCallbackWithParameters & ((*args: object, **kwargs: object) -> object))`
+ src/prefect/utilities/_engine.py:64:13: error[invalid-argument-type] Argument to bound method `is_callback_with_parameters` is incorrect: Expected `(...) -> str`, found `(Unknown & Top[(...) -> object]) | (str & Top[(...) -> object]) | (() -> str) | TaskRunNameCallbackWithParameters`
+ src/prefect/utilities/_engine.py:66:48: error[unknown-argument] Argument `parameters` does not match any known parameter
+ src/prefect/utilities/_engine.py:69:29: error[missing-argument] No argument provided for required parameter `parameters` of bound method `__call__`
- Found 5416 diagnostics
+ Found 5486 diagnostics

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- ddtrace/debugging/_redaction.py:16:5: error[unsupported-operator] Operator `|` is not supported between objects of type `frozenset[str | Unknown]` and `Unknown | EnvVariable[set[Unknown]]`
+ ddtrace/debugging/_redaction.py:16:5: error[unsupported-operator] Operator `|` is not supported between objects of type `frozenset[Unknown | str]` and `Unknown | EnvVariable[set[Unknown]]`
- tests/tracer/test_span.py:193:29: error[invalid-argument-type] Argument to bound method `set_metric` is incorrect: Expected `int | float`, found `int | float | complex | ... omitted 6 union elements`
+ tests/tracer/test_span.py:193:29: error[invalid-argument-type] Argument to bound method `set_metric` is incorrect: Expected `int | float`, found `str | Unknown | None | ... omitted 6 union elements`

bokeh (https://github.com/bokeh/bokeh)
- src/bokeh/layouts.py:670:16: error[invalid-return-type] Return type does not match returned value: expected `list[L@_parse_children_arg]`, found `list[L@_parse_children_arg | list[L@_parse_children_arg]]`
+ src/bokeh/layouts.py:670:21: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Iterable[L@_parse_children_arg]`, found `tuple[L@_parse_children_arg | list[L@_parse_children_arg], ...]`

materialize (https://github.com/MaterializeInc/materialize)
- misc/python/materialize/cli/mz_workload_anonymize.py:251:13: error[no-matching-overload] No overload of bound method `join` matches arguments
- Found 537 diagnostics
+ Found 536 diagnostics

pandas (https://github.com/pandas-dev/pandas)
- pandas/core/methods/describe.py:214:21: error[not-iterable] Object of type `Unknown | Sized` may not be iterable
+ pandas/core/methods/describe.py:214:21: error[not-iterable] Object of type `Sized | Unknown` may not be iterable

scikit-learn (https://github.com/scikit-learn/scikit-learn)
- sklearn/utils/tests/test_multiclass.py:399:27: error[unresolved-attribute] Attribute `toarray` is not defined on `list[Unknown | list[Unknown | int]] & SparseABC`, `ndarray[tuple[Any, ...], dtype[Any]] & SparseABC`, `_NotAnArray & SparseABC`, `list[Unknown | int] & SparseABC`, `list[Unknown | str] & SparseABC`, `list[Unknown | list[Unknown | str]] & SparseABC`, `list[Unknown] & SparseABC`, `list[Unknown | int | float] & SparseABC`, `list[Unknown | list[Unknown]] & SparseABC`, `list[Unknown | tuple[()]] & SparseABC`, `list[Unknown | ndarray[tuple[Any, ...], dtype[Unknown]]] & SparseABC`, `list[Unknown | set[Unknown | int]] & SparseABC`, `list[Unknown | frozenset[Unknown | int]] & SparseABC`, `list[Unknown | dict[Unknown | int, Unknown | str]] & SparseABC` in union `(Unknown & SparseABC) | (list[Unknown | list[Unknown | int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Any]] & SparseABC) | ... omitted 12 union elements`
+ sklearn/utils/tests/test_multiclass.py:399:27: error[unresolved-attribute] Attribute `toarray` is not defined on `list[Unknown | list[Unknown | int]] & SparseABC`, `ndarray[tuple[Any, ...], dtype[Any]] & SparseABC`, `_NotAnArray & SparseABC`, `list[Unknown | int] & SparseABC`, `list[Unknown | str] & SparseABC`, `list[Unknown | list[Unknown | str]] & SparseABC`, `list[Unknown] & SparseABC`, `list[Unknown | int | float] & SparseABC`, `list[Unknown | list[Unknown]] & SparseABC`, `list[Unknown | tuple[()]] & SparseABC`, `list[Unknown | ndarray[tuple[Any, ...], dtype[Unknown]]] & SparseABC`, `list[Unknown | set[Unknown | int]] & SparseABC`, `list[Unknown | frozenset[int | Unknown]] & SparseABC`, `list[Unknown | dict[Unknown | int, Unknown | str]] & SparseABC` in union `(Unknown & SparseABC) | (list[Unknown | list[Unknown | int]] & SparseABC) | (ndarray[tuple[Any, ...], dtype[Any]] & SparseABC) | ... omitted 12 union elements`

sympy (https://github.com/sympy/sympy)
- sympy/parsing/mathematica.py:692:38: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Iterable[Never]`, found `Unknown | list[Unknown | str]`
- sympy/simplify/cse_main.py:299:23: error[not-iterable] Object of type `Unknown | Sized` may not be iterable
+ sympy/simplify/cse_main.py:299:23: error[not-iterable] Object of type `Sized | Unknown` may not be iterable
- sympy/simplify/cse_main.py:305:16: error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `Unknown | Sized`
+ sympy/simplify/cse_main.py:305:16: error[unsupported-operator] Operator `in` is not supported between objects of type `Unknown` and `Sized | Unknown`
- sympy/tensor/indexed.py:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `None`, `int`, `float`, `complex` in union `None | Any | Basic | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:650:12: error[unresolved-attribute] Attribute `is_Number` is not defined on `int`, `float`, `complex`, `None` in union `Any | Basic | int | ... omitted 3 union elements`
- sympy/tensor/indexed.py:651:20: error[unresolved-attribute] Attribute `is_integer` is not defined on `None`, `int`, `complex` in union `None | Any | Basic | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:651:20: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `Any | Basic | int | ... omitted 3 union elements`
- sympy/tensor/indexed.py:655:16: error[unresolved-attribute] Attribute `is_integer` is not defined on `None`, `int`, `complex` in union `None | Any | Basic | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:655:16: error[unresolved-attribute] Attribute `is_integer` is not defined on `int`, `complex`, `None` in union `Any | Basic | int | ... omitted 3 union elements`
- sympy/tensor/indexed.py:678:33: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `None | Any | Basic | ... omitted 3 union elements`
+ sympy/tensor/indexed.py:678:33: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `Basic`, found `Any | Basic | int | ... omitted 3 union elements`
- Found 16066 diagnostics
+ Found 16065 diagnostics

jax (https://github.com/google/jax)
- jax/_src/export/_export.py:1376:45: error[invalid-argument-type] Argument to function `_get_named_sharding` is incorrect: Expected `ShapedArray`, found `AbstractValue | Unknown`
+ jax/_src/export/_export.py:1376:45: error[invalid-argument-type] Argument to function `_get_named_sharding` is incorrect: Expected `ShapedArray`, found `Unknown | AbstractValue`
- jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `Unknown | PathLike[str] | int | ... omitted 3 union elements`
+ jax/collect_profile.py:110:17: error[unresolved-attribute] Attribute `glob` is not defined on `PathLike[str]`, `int`, `str`, `bytes`, `PathLike[bytes]` in union `PathLike[str] | Unknown | int | ... omitted 3 union elements`
- jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `Unknown | PathLike[str] | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`
+ jax/collect_profile.py:113:22: error[unsupported-operator] Operator `/` is not supported between objects of type `PathLike[str] | Unknown | int | ... omitted 3 union elements` and `Literal["remote.trace.json.gz"]`

pandas-stubs (https://github.com/pandas-dev/pandas-stubs)
+ tests/series/test_series.py:2429:9: error[type-assertion-failure] Type `Series[Timestamp]` does not match asserted type `Unknown`
- Found 4679 diagnostics
+ Found 4680 diagnostics

scipy (https://github.com/scipy/scipy)
- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`
- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:113:76: error[unresolved-attribute] Attribute `dtype` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`
- subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `Any | tuple[Any, ...]`
+ subprojects/array_api_compat/array_api_compat/array_api_compat/common/_linalg.py:117:15: error[unresolved-attribute] Attribute `max` is not defined on `tuple[Any, ...]` in union `tuple[Any, ...] | Any`

@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 0796bbf to 4b0f2d4 Compare January 30, 2026 01:04
@amyreese amyreese changed the base branch from amy/ruffen-docs-extension to amy/ruffen-docs-line-by-line January 30, 2026 01:05
@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 4b0f2d4 to 1165d9f Compare February 2, 2026 22:21
@amyreese amyreese changed the base branch from amy/ruffen-docs-line-by-line to amy/ruffen-docs-extension February 2, 2026 22:21
@amyreese
Copy link
Member Author

amyreese commented Feb 2, 2026

Rebased onto #22996 and #22934, added some #fmt:skip and #fmt:off to preserve some intentional formatting choices, and updated the prek hook, and re-ran the hook and updated test snapshots.

@amyreese amyreese force-pushed the amy/ruffen-docs-extension branch from cefa871 to b32cf11 Compare February 3, 2026 18:46
Base automatically changed from amy/ruffen-docs-extension to main February 3, 2026 22:00
@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch 2 times, most recently from e435d83 to 1f54054 Compare February 5, 2026 16:22
@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 1f54054 to 16934d6 Compare February 5, 2026 16:39
@amyreese
Copy link
Member Author

amyreese commented Feb 5, 2026

I think this is blocked on waiting for the next release of ruff so that it doesn't depend on trying to cargo run from the local repo.

@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch 2 times, most recently from 9a24d60 to e79a977 Compare February 9, 2026 19:48
@amyreese amyreese marked this pull request as ready for review February 9, 2026 20:31
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you for doing this!!

We still have a few <!-- blacken-docs:off --> HTML comments in the resources/mdtest directory. As a followup, we should audit those to see which ones are no longer necessary (because ruffen-docs, unlike blacken-docs, will automatically skip examples that include invalid Python syntax in them). And it would be nice to switch over the ones that we do still need to use <!-- fmt:off --> rather than a blacken-docs-specific comment. (This will require changing the hardcoded allowlist of HMTL comments at

const HTML_COMMENT_ALLOWLIST: &[&str] = &["blacken-docs:on", "blacken-docs:off"];
)

from b import Foo

__all__ = ['Foo']
__all__ = ["Foo"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh, I wonder why blacken-docs didn't complain about this one

@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from e79a977 to 1a86e75 Compare February 10, 2026 00:08
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it! :D

@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 1a86e75 to 5981b2e Compare February 13, 2026 16:14
@astral-sh-bot
Copy link

astral-sh-bot bot commented Feb 13, 2026

Memory usage report

Memory usage unchanged ✅

@amyreese amyreese force-pushed the amy/ruffen-mdtests-mapped branch from 5981b2e to e2ee456 Compare February 13, 2026 16:32
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's go

@amyreese amyreese merged commit 09db380 into main Feb 13, 2026
50 checks passed
@amyreese amyreese deleted the amy/ruffen-mdtests-mapped branch February 13, 2026 16:48
@amyreese amyreese added the internal An internal refactor or improvement label Feb 13, 2026
carljm added a commit that referenced this pull request Feb 14, 2026
* main: (209 commits)
  [ty] Defer base inference for functional `type(...)` classes (#22792)
  flake8-executable: allow global flags in uv shebangs (EXE003) (#22582)
  [ty] Add `replace-imports-with-any` option (#23122)
  Update html comments in mdtests (#23269)
  Apply ruff formatting to mdtests (#22935)
  [ty] Exclude test-related symbols from non-first-party packages in auto-import completions
  [ty] Refactor `CursorTest` helper to support site-packages
  [ty] Qualify inlay hint edit symbol when possibly referencing another variable (#23265)
  [ty] Avoid `UnionBuilder` overhead when creating a new union from the filtered elements of an existing union (#22352)
  [ty] Refactor TypedDict key assignment validation (#23262)
  [ty] Improve Python environment path documentation (#23256)
  [ty] loop control flow analysis using loop header definitions
  Prepare for 0.15.1 (#23253)
  Remove docker-run-action (#23254)
  [ty] Allow discovering dependencies in system Python environments (#22994)
  Ensure pending suppression diagnostics are reported (#23242)
  [`isort`] support for configurable import section heading comments (#23151)
  [ty] Fix method calls on subclasses of `Any` (#23248)
  [ty] Fix bound method access on `None` (#23246)
  Make range suppression test snapshot actually useful (#23251)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adopt ruffen docs in ty mdtests

2 participants