diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 9f46a94d7..3039e8160 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -40,6 +40,17 @@ stubs serve more as a starting point. For more details, see `pyright docs `__. +pyrefly +------- + +Pyrefly also contains a tool to generate stubs. Unlike stubgen and pyright, this tool will aggressively infer types for un-annotated code, including function parameters, resulting in stubs that contain more non-``Any`` annotations. + +.. code-block:: console + + pyrefly stubgen path/to/directory/ + +For more details, see `pyrefly docs `__. + monkeytype ---------- diff --git a/docs/index.rst b/docs/index.rst index 35857a09c..93f773ac5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -105,7 +105,7 @@ Development Environments * `PyCharm `_, an IDE that supports type stubs both for type checking and code completion. * `Visual Studio Code `_, a code editor that - supports type checking using mypy, pyright, or the + supports type checking using mypy, pyrefly, pyright, ty, Zuban, or the `Pylance `_ extension. @@ -130,3 +130,5 @@ Type-Hint and Stub Integration a thin wrapper around ``ApplyTypeAnnotationsVisitor`` from `libCST `_ that integrates .pyi signatures as inline type-hints in Python source code. +* `pyrefly infer `_, a sub-command of Pyrefly which + inserts the types that Pyrefly infers as inline type-hints. diff --git a/docs/reference/quality.rst b/docs/reference/quality.rst index c8fed8332..19918fcb4 100644 --- a/docs/reference/quality.rst +++ b/docs/reference/quality.rst @@ -221,3 +221,15 @@ Mypy reports Mypy offers several options for generating reports on its analysis. See `the mypy documentation on report generation `_ for details. + + +Pyrefly coverage +---------------- + +Pyrefly offers a sub-command for measuring and checking type coverage. + +- ``pyrefly coverage check`` fails when coverage is below a threshold, useful as a CI gate. +- ``pyrefly coverage report`` emits a JSON report with per-module statistics. + +See `the Pyrefly docs on measuring type coverage +`_ for details.