ruff/crates
Simon 6cdf996af6
[red-knot] feat: introduce a new [Type::Todo] variant (#13548)
This variant shows inference that is not yet implemented..

## Summary

PR #13500 reopened the idea of adding a new type variant to keep track
of not-implemented features in Red Knot.

It was based off of #12986 with a more generic approach of keeping track
of different kind of unknowns. Discussion in #13500 agreed that keeping
track of different `Unknown` is complicated for now, and this feature is
better achieved through a new variant of `Type`.

### Requirements

Requirements for this implementation can be summed up with some extracts
of comment from @carljm on the previous PR

> So at the moment we are leaning towards simplifying this PR to just
use a new top-level variant, which behaves like Any and Unknown but
represents inference that is not yet implemented in red-knot.

> I think the general rule should be that Todo should propagate only
when the presence of the input Todo caused the output to be unknown.
>
> To take a specific example, the inferred result of addition must be
Unknown if either operand is Unknown. That is, Unknown + X will always
be Unknown regardless of what X is. (Same for X + Unknown.) In this
case, I believe that Unknown + Todo (or Todo + Unknown) should result in
Unknown, not result in Todo. If we fix the upstream source of the Todo,
the result would still be Unknown, so it's not useful to propagate the
Todo in this case: it wrongly suggests that the output is unknown
because of a todo item.

## Test Plan

This PR does not introduce new tests, but it did required to edit some
tests with the display of `[Type::Todo]` (currently `@Todo`), which
suggests that those test are placeholders requirements for features we
don't support yet.
2024-09-30 14:28:06 -07:00
..
red_knot Use an empty vendored file system in Ruff (#13436) 2024-09-21 16:31:42 +00:00
red_knot_python_semantic [red-knot] feat: introduce a new [Type::Todo] variant (#13548) 2024-09-30 14:28:06 -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 Use an empty vendored file system in Ruff (#13436) 2024-09-21 16:31:42 +00:00
red_knot_workspace Use an empty vendored file system in Ruff (#13436) 2024-09-21 16:31:42 +00:00
ruff Fix leftover references to red_knot_python_semantic/vendor/ (#13561) 2024-09-30 11:32:02 +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 Use an empty vendored file system in Ruff (#13436) 2024-09-21 16:31:42 +00:00
ruff_dev Fix parentheses around return type annotations (#13381) 2024-09-20 09:23:53 +02: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_graph Don't skip over imports and other nodes containing nested statements in import collector (#13521) 2024-09-26 11:57:05 +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 [flake8-use-pathlib] Fix typo in link to Path.stat (PTH116) (#13546) 2024-09-28 12:01:41 -04: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 [internal] ComparableExpr (f)strings and bytes made invariant under concatenation (#13301) 2024-09-25 16:58:57 +02:00
ruff_python_ast_integration_tests [internal] ComparableExpr (f)strings and bytes made invariant under concatenation (#13301) 2024-09-25 16:58:57 +02:00
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: Simplify quote selection logic (#13536) 2024-09-27 14:40:28 +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 Expose internal types as public access (#13509) 2024-09-26 17:34:30 +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 Detect tuples bound to variadic positional arguments i.e. *args (#13512) 2024-09-25 10:03:25 -05: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_vendored Fix leftover references to red_knot_python_semantic/vendor/ (#13561) 2024-09-30 11:32:02 +00:00
ruff_wasm Bump version to 0.6.8 (#13522) 2024-09-26 14:09:03 +02:00
ruff_workspace Fix formatting for analyze direction values (#13476) 2024-09-23 09:18:28 +02:00