[ty] Add --venv as an alias to --python by AlexWaygood · Pull Request #20718 · astral-sh/ruff (original) (raw)

Summary

This PR adds --venv as an alias to --python on the ty CLI. The motivation is that if you're just skimming the online docs for the CLI interface, this may make it easier to spot at a glance that this option should be used to specify the location of your virtual environment. (See the changes to the generated cli.md file in this PR.)

We shouldn't rename the option to --venv because it can also be used to point to a system environment. It's tempting to add a --venv-path alias, which would match the name of one of pyright's options, but pyright's --venv-path option has different semantics, so that would probably cause more confusion rather than clarifying anything.

Helps with astral-sh/ty#1289