mirror of
https://github.com/astral-sh/ruff
synced 2026-01-21 05:20:49 -05:00
[ty] Add evaluation tasks for a few cases
I went through https://github.com/astral-sh/ty/issues/1274 and tried to extract what I could into eval tasks. Some of the suggestions from that issue have already been done, but most haven't. This captures the status quo.
This commit is contained in:
committed by
Andrew Gallant
parent
e61657ff3c
commit
d4c1b0ccc7
@@ -4,6 +4,7 @@ auto-import-includes-modules,main.py,1,7
|
||||
auto-import-includes-modules,main.py,2,1
|
||||
auto-import-skips-current-module,main.py,0,1
|
||||
class-arg-completion,main.py,0,1
|
||||
exact-over-fuzzy,main.py,0,2
|
||||
fstring-completions,main.py,0,1
|
||||
higher-level-symbols-preferred,main.py,0,
|
||||
higher-level-symbols-preferred,main.py,1,1
|
||||
@@ -16,6 +17,7 @@ import-deprioritizes-type_check_only,main.py,3,2
|
||||
import-deprioritizes-type_check_only,main.py,4,3
|
||||
import-keyword-completion,main.py,0,1
|
||||
internal-typeshed-hidden,main.py,0,2
|
||||
local-over-auto-import,main.py,0,1
|
||||
none-completion,main.py,0,1
|
||||
numpy-array,main.py,0,159
|
||||
numpy-array,main.py,1,1
|
||||
@@ -26,7 +28,12 @@ raise-uses-base-exception,main.py,0,1
|
||||
scope-existing-over-new-import,main.py,0,1
|
||||
scope-prioritize-closer,main.py,0,2
|
||||
scope-simple-long-identifier,main.py,0,1
|
||||
tighter-over-looser-scope,main.py,0,3
|
||||
tstring-completions,main.py,0,1
|
||||
ty-extensions-lower-stdlib,main.py,0,9
|
||||
type-var-typing-over-ast,main.py,0,3
|
||||
type-var-typing-over-ast,main.py,1,253
|
||||
typing-gets-priority,main.py,0,31
|
||||
typing-gets-priority,main.py,1,3
|
||||
typing-gets-priority,main.py,2,3
|
||||
typing-gets-priority,main.py,3,96
|
||||
|
||||
|
@@ -0,0 +1,2 @@
|
||||
[settings]
|
||||
auto-import = true
|
||||
3
crates/ty_completion_eval/truth/exact-over-fuzzy/main.py
Normal file
3
crates/ty_completion_eval/truth/exact-over-fuzzy/main.py
Normal file
@@ -0,0 +1,3 @@
|
||||
pattern = 1
|
||||
pttn = 1
|
||||
pttn<CURSOR: pttn>
|
||||
@@ -0,0 +1,5 @@
|
||||
[project]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
8
crates/ty_completion_eval/truth/exact-over-fuzzy/uv.lock
generated
Normal file
8
crates/ty_completion_eval/truth/exact-over-fuzzy/uv.lock
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
@@ -0,0 +1,2 @@
|
||||
[settings]
|
||||
auto-import = true
|
||||
@@ -0,0 +1,11 @@
|
||||
def foo(x):
|
||||
# We specifically want the local `x` to be
|
||||
# suggested first here, and NOT an `x` or an
|
||||
# `X` from some other module (via auto-import).
|
||||
# We'd also like this to come before `except`,
|
||||
# which is a keyword that contains `x`, but is
|
||||
# not an exact match (where as `x` is). `except`
|
||||
# also isn't legal in this context, although
|
||||
# that sort of context sensitivity is a bit
|
||||
# trickier.
|
||||
return x<CURSOR: x>
|
||||
@@ -0,0 +1,5 @@
|
||||
[project]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
8
crates/ty_completion_eval/truth/local-over-auto-import/uv.lock
generated
Normal file
8
crates/ty_completion_eval/truth/local-over-auto-import/uv.lock
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
@@ -0,0 +1,2 @@
|
||||
[settings]
|
||||
auto-import = true
|
||||
@@ -0,0 +1,10 @@
|
||||
scope1 = 1
|
||||
def x():
|
||||
scope2 = 1
|
||||
def xx():
|
||||
scope3 = 1
|
||||
def xxx():
|
||||
# We specifically want `scope3` to be
|
||||
# suggested first here, since that's in
|
||||
# the "tighter" scope.
|
||||
scope<CURSOR: scope3>
|
||||
@@ -0,0 +1,5 @@
|
||||
[project]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
8
crates/ty_completion_eval/truth/tighter-over-looser-scope/uv.lock
generated
Normal file
8
crates/ty_completion_eval/truth/tighter-over-looser-scope/uv.lock
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
@@ -0,0 +1,2 @@
|
||||
[settings]
|
||||
auto-import = true
|
||||
12
crates/ty_completion_eval/truth/typing-gets-priority/main.py
Normal file
12
crates/ty_completion_eval/truth/typing-gets-priority/main.py
Normal file
@@ -0,0 +1,12 @@
|
||||
# We should prefer `typing` over `asyncio` here.
|
||||
class Foo(Protoco<CURSOR: typing.Protocol>): ...
|
||||
|
||||
# We should prefer `typing` over `ty_extensions`
|
||||
# or `typing_extensions`.
|
||||
reveal_<CURSOR: typing.reveal_type>
|
||||
|
||||
# We should prefer `typing` over `ast`.
|
||||
TypeVa<CURSOR: typing.TypeVar>
|
||||
|
||||
# We should prefer `typing` over `ctypes`.
|
||||
cast<CURSOR: typing.cast>
|
||||
@@ -0,0 +1,5 @@
|
||||
[project]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.13"
|
||||
dependencies = []
|
||||
8
crates/ty_completion_eval/truth/typing-gets-priority/uv.lock
generated
Normal file
8
crates/ty_completion_eval/truth/typing-gets-priority/uv.lock
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[[package]]
|
||||
name = "test"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
Reference in New Issue
Block a user