Skip to content

[ty] Support generate-shell-completion#17879

Merged
carljm merged 2 commits intoastral-sh:mainfrom
InSyncWithFoo:ty-shell-completion
May 7, 2025
Merged

[ty] Support generate-shell-completion#17879
carljm merged 2 commits intoastral-sh:mainfrom
InSyncWithFoo:ty-shell-completion

Conversation

@InSyncWithFoo
Copy link
Contributor

@InSyncWithFoo InSyncWithFoo commented May 6, 2025

Summary

Resolves #15502.

ty generate-shell-completion now works in a similar manner to ruff generate-shell-completion.

Test Plan

Manually:

Details
$ cargo run --package ty generate-shell-completion nushell
module completions {

  # An extremely fast Python type checker.
  export extern ty [
    --help(-h)                # Print help
    --version(-V)             # Print version
  ]
  
  # ...

}

export use completions *

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

mypy_primer results

No ecosystem changes detected ✅

@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)

mesonbuild/meson-python (error)

warning: Detected debug build without --no-cache.
error: Failed to read tests/packages/symlinks/baz.py: No such file or directory (os error 2)
error: Failed to read tests/packages/symlinks/qux.py: No such file or directory (os error 2)

Formatter (preview)

ℹ️ ecosystem check encountered format errors. (no format changes; 1 project error)

mesonbuild/meson-python (error)

ruff format --preview

warning: Detected debug build without --no-cache.
error: Failed to read tests/packages/symlinks/baz.py: No such file or directory (os error 2)
error: Failed to read tests/packages/symlinks/qux.py: No such file or directory (os error 2)

@AlexWaygood AlexWaygood removed their request for review May 6, 2025 06:37
@AlexWaygood AlexWaygood added the ty Multi-file analysis & type inference label May 6, 2025
Copy link
Member

@MichaReiser MichaReiser left a comment

Choose a reason for hiding this comment

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

Thanks

I've come around to accept ty generate-shell-completion because I think ty completion might be confusing, considering that ty provides completions in editors.

@MichaReiser
Copy link
Member

This is ready to go but requires a rebase

@carljm carljm removed their request for review May 6, 2025 17:37
@carljm carljm merged commit a33d0d4 into astral-sh:main May 7, 2025
35 checks passed
dcreager added a commit that referenced this pull request May 7, 2025
* main:
  [ty] Support `generate-shell-completion` (#17879)
  Remove condensed display type enum (#17902)
  Update class literal display to use `<class 'Foo'>` style (#17889)
@InSyncWithFoo InSyncWithFoo deleted the ty-shell-completion branch May 7, 2025 01:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[red-knot] Shell completion

4 participants