ruff/crates
Carl Meyer a6d3d2fccd
[red-knot] support reveal_type as pseudo-builtin (#13403)
Support using `reveal_type` without importing it, as implied by the type
spec and supported by existing type checkers.

We use `typing_extensions.reveal_type` for the implicit built-in; this
way it exists on all Python versions. (It imports from `typing` on newer
Python versions.)

Emits an "undefined name" diagnostic whenever `reveal_type` is
referenced in this way (in addition to the revealed-type diagnostic when
it is called). This follows the mypy example (with `--enable-error-code
unimported-reveal`) and I think provides a good (and easily
understandable) balance for user experience. If you are using
`reveal_type` for quick temporary debugging, the additional
undefined-name diagnostic doesn't hinder that use case. If we make the
revealed-type diagnostic a non-failing one, the undefined-name
diagnostic can still be a failing diagnostic, helping prevent
accidentally leaving it in place. For any use cases where you want to
leave it in place, you can always import it to avoid the undefined-name
diagnostic.

In the future, we can easily provide configuration options to a) turn
off builtin-reveal_type altogether, and/or b) silence the undefined-name
diagnostic when using it, if we have users on either side (loving or
hating pseudo-builtin `reveal_type`) who are dissatisfied with this
compromise.
2024-09-19 07:58:08 -07:00
..
red_knot [red-knot] Add docs on using RAYON_NUM_THREADS for better logging (#13140) 2024-08-28 17:14:56 +01:00
red_knot_python_semantic [red-knot] support reveal_type as pseudo-builtin (#13403) 2024-09-19 07:58:08 -07:00
red_knot_server [red-knot] Support untitled files in the server (#13044) 2024-08-23 12:47:35 +05:30
red_knot_wasm [red-knot] Improve the accuracy of the unresolved-import check (#13055) 2024-08-27 14:17:22 +01:00
red_knot_workspace [red-knot] fix scope inference with deferred types (#13204) 2024-09-03 11:20:43 -07:00
ruff Fix off-by one error in the LineIndex::offset calculation (#13407) 2024-09-19 11:58:45 +00:00
ruff_benchmark [red-knot] use declared types in inference/checking (#13335) 2024-09-17 08:11:06 -07:00
ruff_cache Fix cache key collisions for paths with separators (#12159) 2024-07-03 07:36:46 -05:00
ruff_db [red-knot] use declared types in inference/checking (#13335) 2024-09-17 08:11:06 -07:00
ruff_dev DOCS: navigate back to rule overview linter (#13368) 2024-09-16 16:21:26 +00:00
ruff_diagnostics [Minor typo] Fix article in "an fix" (#12797) 2024-08-10 21:22:00 -04:00
ruff_formatter Upgrade to Rust 1.80 (#12586) 2024-07-30 19:18:08 +00:00
ruff_index [red-knot] small efficiency improvements and bugfixes to use-def map building (#12373) 2024-07-18 09:24:58 -07:00
ruff_linter Fix rendering of FURB188 docs (#13406) 2024-09-19 07:29:31 +00:00
ruff_macros Drop deprecated nursery rule group (#10172) 2024-06-27 13:44:11 +02:00
ruff_notebook Fallback to kernelspec to check if it's a Python notebook (#12875) 2024-08-14 12:36:09 +05:30
ruff_python_ast [red-knot] Add control flow support for match statement (#13241) 2024-09-10 02:14:19 +05:30
ruff_python_ast_integration_tests [red-knot] Add control flow support for match statement (#13241) 2024-09-10 02:14:19 +05:30
ruff_python_codegen Implement iter(), len() and is_empty() for all display-literal AST nodes (#12807) 2024-08-12 10:39:28 +00:00
ruff_python_formatter refactor: remove unnecessary string hashes (#13250) 2024-09-18 19:08:59 +02:00
ruff_python_index Enable token-based rules on source with syntax errors (#11950) 2024-07-02 08:57:46 +00:00
ruff_python_literal Remove some unused pub functions (#11576) 2024-05-28 09:56:51 -04:00
ruff_python_parser Upgrade to Rust 1.81 (#13265) 2024-09-06 15:09:09 +02:00
ruff_python_resolver chore(deps): update rust crate insta to v1.38.0 (#10701) 2024-04-01 15:44:30 +00:00
ruff_python_semantic Optimize some SemanticModel methods (#13091) 2024-09-02 10:03:52 +01:00
ruff_python_stdlib Remove allocation from ruff_python_stdlib::builtins::python_builtins (#13317) 2024-09-10 16:34:24 -04:00
ruff_python_trivia Fix placement of inline parameter comments (#13379) 2024-09-18 08:26:06 +02:00
ruff_python_trivia_integration_tests Build CommentRanges outside the parser (#11792) 2024-06-09 09:55:17 +00:00
ruff_server Add support for extensionless Python files for server (#13326) 2024-09-12 00:35:26 +05:30
ruff_source_file Fix off-by one error in the LineIndex::offset calculation (#13407) 2024-09-19 11:58:45 +00:00
ruff_text_size Upgrade to Rust 1.79 (#11875) 2024-06-17 07:15:10 +01:00
ruff_wasm Bump version to 0.6.5 (#13346) 2024-09-13 20:12:26 +05:30
ruff_workspace Fix configuration inheritance for configurations specified in the LSP settings (#13285) 2024-09-09 19:46:39 +01:00