ruff/crates
Zanie Blue f7237e3b69
Update `ty version` to use parent Git repository information (#17866)
Currently, `ty version` pulls its information from the Ruff repository —
but we want this to pull from the repository in the directory _above_
when Ruff is a submodule.

I tested this in the `ty` repository after tagging an arbitrary commit:

```
❯ uv run --refresh-package ty --reinstall-package ty ty version
      Built ty @ file:///Users/zb/workspace/ty
Uninstalled 1 package in 2ms
Installed 1 package in 1ms
ty 0.0.0+3 (34253b1d4 2025-05-05)
```

We also use the last Git tag as the source of truth for the version,
instead of the crate version. However, we'll need a way to set the
version for releases still, as the tag is published _after_ the build.
We can either tag early (without pushing the tag to the remote), or add
another environment variable. (**Note, this approach is changed in a
follow-up. See https://github.com/astral-sh/ruff/pull/17868**)

From this repository, the version will be `unknown`:

```
❯ cargo run -q --bin ty -- version
ty unknown
```

We could add special handling like... `ty unknown (ruff@...)` but I see
that as a secondary goal.

Closes https://github.com/astral-sh/ty/issues/5

The reviewer situation in this repository is unhinged, cc @Gankra and
@MichaReiser for review.
2025-05-06 07:14:30 -05:00
..
ruff [`isort`] Check full module path against project root(s) when categorizing first-party (#16565) 2025-05-05 11:40:01 -05:00
ruff_annotate_snippets ruff_annotate_snippets: address unused code warnings 2025-04-07 08:24:08 -04:00
ruff_benchmark Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_cache Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_db Show a warning at the end of the diagnostic list if there are any fatal warnings (#17855) 2025-05-06 07:14:21 +00:00
ruff_dev Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_diagnostics Show errors for attempted fixes only when passed `--verbose` (#15237) 2025-01-03 08:50:13 -06:00
ruff_formatter Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_graph Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
ruff_index Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_linter [`pylint`] Add fix safety section (`PLR1722`) (#17826) 2025-05-05 19:13:04 -04:00
ruff_macros Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_notebook Split `SourceLocation` into `LineColumn` and `SourceLocation` (#17587) 2025-04-27 11:27:33 +01:00
ruff_python_ast Implement deferred annotations for Python 3.14 (#17658) 2025-05-05 06:40:36 -05:00
ruff_python_ast_integration_tests Visit `Identifier` node as part of the `SourceOrderVisitor` (#17110) 2025-04-01 16:58:09 +02:00
ruff_python_codegen Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_formatter Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_index Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_literal Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_parser Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_resolver Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_semantic [`isort`] Check full module path against project root(s) when categorizing first-party (#16565) 2025-05-05 11:40:01 -05:00
ruff_python_stdlib Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_trivia Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_python_trivia_integration_tests Pass `ParserOptions` to the parser (#16220) 2025-02-19 10:50:50 -05:00
ruff_server Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_source_file Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_text_size Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ruff_wasm Bump 0.11.8 (#17766) 2025-05-01 10:19:58 -04:00
ruff_workspace Fix missing `combine` call for `lint.typing-extensions` setting (#17823) 2025-05-03 18:19:19 -04:00
ty Update `ty version` to use parent Git repository information (#17866) 2025-05-06 07:14:30 -05:00
ty_ide Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ty_project [ty] Fix standalone expression type retrieval in presence of cycles (#17849) 2025-05-05 13:52:08 +02:00
ty_python_semantic [ty] Fix duplicate diagnostics for unresolved module when an `import from` statement imports multiple members (#17886) 2025-05-06 12:37:10 +01:00
ty_server Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ty_test Use `#[expect(lint)]` over `#[allow(lint)]` where possible (#17822) 2025-05-03 21:20:31 +02:00
ty_vendored Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
ty_wasm [ty] Fix duplicate diagnostics for unresolved module when an `import from` statement imports multiple members (#17886) 2025-05-06 12:37:10 +01:00