Commit Graph

817 Commits

Author SHA1 Message Date
Micha Reiser 35a33f045e
[ty] Merge `ty_macros` into `ruff_macros` (#19229) 2025-07-09 11:28:21 +00:00
Charlie Marsh 3ee3434187
Auto-generate environment variable references for ty (#19205)
## Summary

This PR mirrors the environment variable implementation we have in uv:
efc361223c/crates/uv-static/src/env_vars.rs (L6-L7).

See: https://github.com/astral-sh/ty/issues/773.
2025-07-08 10:48:31 -04:00
renovate[bot] 845a1eeba6
Update Rust crate indicatif to 0.18.0 (#19165)
## Summary

Updates `indicatif` and `tracing-indicatif`.
2025-07-07 13:19:23 -04:00
Micha Reiser e9b5ea71b3
Update Salsa (#19020)
## Summary

This PR updates Salsa to pull in Ibraheem's multithreading improvements (https://github.com/salsa-rs/salsa/pull/921).

## Performance

A small regression for single-threaded benchmarks is expected because
papaya is slightly slower than a `Mutex<FxHashMap>` in the uncontested
case (~10%). However, this shouldn't matter as much in practice because:

1. Salsa has a fast-path when only using 1 DB instance which is the
common case in production. This fast-path is not impacted by the changes
but we measure the slow paths in our benchmarks (because we use multiple
db instances)
2. Fixing the 10x slowdown for the congested case (multi threading)
outweights the downsides of a 10% perf regression for single threaded
use cases, especially considering that ty is heavily multi threaded.

## Test Plan

`cargo test`
2025-07-02 09:55:37 -04:00
Brent Westbrook 47733c0647
Remove new codspeed dependencies (#19073)
Summary
--

Updates to codspeed 3.0.2, removing some of the new dependencies
introduced in 3.0. See https://github.com/astral-sh/uv/pull/14396 and
https://github.com/CodSpeedHQ/codspeed-rust/pull/108 for the similar PR
in uv and the upstream fix, respectively.

Test Plan
--

N/a
2025-07-01 12:20:31 -04:00
Adrien Cacciaguerra 4fbf7e9de8
Bump CodSpeed to v3 (#19046)
## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
As discussed on Slack, there was an issue with the walltime metrics with
`divan`. The issue was fixed with the latest version of `cargo-codspeed`
and `codpseed-divan-compat`:
https://github.com/CodSpeedHQ/codspeed-rust/releases/tag/v3.0.0.

This PR updates all crates related to CodSpeed. A performance increase
of the following benchmarks is expected, as now the correct metric will
be used.

```
crates/ruff_benchmark/benches/ty_walltime.rs::multithreaded[pydantic]
crates/ruff_benchmark/benches/ty_walltime.rs::small[altair]
crates/ruff_benchmark/benches/ty_walltime.rs::small[freqtrade]
crates/ruff_benchmark/benches/ty_walltime.rs::small[pydantic]
crates/ruff_benchmark/benches/ty_walltime.rs::small[tanjun]
```

Once this is merged, we will update the historic data of the affected
benchmark on the CodSpeed UI, so that no false positives will appear.
2025-06-30 10:11:23 -04:00
Micha Reiser 29927f2b59
Update Rust toolchain to 1.88 and MSRV to 1.86 (#19011) 2025-06-28 20:24:00 +02:00
Ibraheem Ahmed 6f7b1c9bb3
[ty] Add environment variable to dump Salsa memory usage stats (#18928)
## Summary

Setting `TY_MEMORY_REPORT=full` will generate and print a memory usage
report to the CLI after a `ty check` run:

```
=======SALSA STRUCTS=======
`Definition`                                       metadata=7.24MB   fields=17.38MB  count=181062
`Expression`                                       metadata=4.45MB   fields=5.94MB   count=92804
`member_lookup_with_policy_::interned_arguments`   metadata=1.97MB   fields=2.25MB   count=35176
...
=======SALSA QUERIES=======
`File -> ty_python_semantic::semantic_index::SemanticIndex`
    metadata=11.46MB  fields=88.86MB  count=1638
`Definition -> ty_python_semantic::types::infer::TypeInference`
    metadata=24.52MB  fields=86.68MB  count=146018
`File -> ruff_db::parsed::ParsedModule`
    metadata=0.12MB   fields=69.06MB  count=1642
...
=======SALSA SUMMARY=======
TOTAL MEMORY USAGE: 577.61MB
    struct metadata = 29.00MB
    struct fields = 35.68MB
    memo metadata = 103.87MB
    memo fields = 409.06MB
```

Eventually, we should integrate these numbers into CI in some form. The
one limitation currently is that heap allocations in salsa structs (e.g.
interned values) are not tracked, but memoized values should have full
coverage. We may also want a peak memory usage counter (that accounts
for non-salsa memory), but that is relatively simple to profile manually
(e.g. `time -v ty check`) and would require a compile-time option to
avoid runtime overhead.
2025-06-26 21:27:51 +00:00
Micha Reiser c1fed55d51
Delete the `ruff_python_resolver` crate (#18933) 2025-06-25 12:53:13 +02:00
Micha Reiser 23261a38a0
[ty] Add more benchmarks (#18714) 2025-06-18 13:41:38 +02:00
Ibraheem Ahmed c9dff5c7d5
[ty] AST garbage collection (#18482)
## Summary

Garbage collect ASTs once we are done checking a given file. Queries
with a cross-file dependency on the AST will reparse the file on demand.
This reduces ty's peak memory usage by ~20-30%.

The primary change of this PR is adding a `node_index` field to every
AST node, that is assigned by the parser. `ParsedModule` can use this to
create a flat index of AST nodes any time the file is parsed (or
reparsed). This allows `AstNodeRef` to simply index into the current
instance of the `ParsedModule`, instead of storing a pointer directly.

The indices are somewhat hackily (using an atomic integer) assigned by
the `parsed_module` query instead of by the parser directly. Assigning
the indices in source-order in the (recursive) parser turns out to be
difficult, and collecting the nodes during semantic indexing is
impossible as `SemanticIndex` does not hold onto a specific
`ParsedModuleRef`, which the pointers in the flat AST are tied to. This
means that we have to do an extra AST traversal to assign and collect
the nodes into a flat index, but the small performance impact (~3% on
cold runs) seems worth it for the memory savings.

Part of https://github.com/astral-sh/ty/issues/214.
2025-06-13 08:40:11 -04:00
Micha Reiser 1f27d53fd5
[ty] File inclusion and exclusion (#18498) 2025-06-12 19:07:31 +02:00
Ibraheem Ahmed 65a2c6d4eb
Update salsa (#18636) 2025-06-12 07:17:00 +02:00
Micha Reiser 3aae1cd59b
Fix incorrect salsa `return_ref` attribute (#18605) 2025-06-11 09:19:57 +02:00
Carl Meyer 9e8a7e9353
update to salsa that doesn't panic silently on cycles (#18450) 2025-06-04 07:40:16 +02:00
Micha Reiser 54f597658c
[ty] Fix multithreading related hangs and panics (#18238) 2025-06-01 11:07:55 +02:00
Micha Reiser 8005ebb405
Update salsa past generational id change (#18362) 2025-05-30 15:31:33 +02:00
David Sherret fbaf826a9d
Only enable `js` feature of `uuid` crate for wasm crates (#18152) 2025-05-26 10:33:51 +01:00
Micha Reiser 3b56c7ca3d
Update salsa (#18212) 2025-05-20 09:19:34 +02:00
Douglas Creager 569c94b71b
Add rustfmt.toml file (#18197)
My editor runs `rustfmt` on save to format Rust code, not `cargo fmt`.

With our recent bump to the Rust 2024 edition, the formatting that
`rustfmt`/`cargo fmt` applies changed. Unfortunately, `rustfmt` and
`cargo fmt` have different behaviors for determining which edition to
use when formatting: `cargo fmt` looks for the Rust edition in
`Cargo.toml`, whereas `rustfmt` looks for it in `rustfmt.toml`. As a
result, whenever I save, I have to remember to manually run `cargo fmt`
before committing/pushing.

There is an open issue asking for `rustfmt` to also look at `Cargo.toml`
when it's present (https://github.com/rust-lang/rust.vim/issues/368),
but it seems like they "closed" that issue just by bumping the default
edition (six years ago, from 2015 to 2018).

In the meantime, this PR adds a `rustfmt.toml` file with our current
Rust edition so that both invocation have the same behavior. I don't
love that this duplicates information in `Cargo.toml`, but I've added a
reminder comment there to hopefully ensure that we bump the edition in
both places three years from now.
2025-05-19 11:40:58 -04:00
renovate[bot] 38c332fe23
Update Rust crate bincode to v2 (#18188)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-19 08:57:09 +02:00
renovate[bot] 12f5e99389
Update Rust crate jod-thread to v1 (#18189)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 08:25:46 +02:00
renovate[bot] b1e6c6edce
Update Rust crate criterion to 0.6.0 (#18179)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-05-19 08:09:18 +02:00
Micha Reiser 9ae698fe30
Switch to Rust 2024 edition (#18129) 2025-05-16 13:25:28 +02:00
Micha Reiser 196e4befba
Update MSRV to 1.85 and toolchain to 1.87 (#18126) 2025-05-16 09:19:55 +02:00
Brent Westbrook e2c5b83fe1
Inline `DiagnosticKind` into other diagnostic types (#18074)
## Summary

This PR deletes the `DiagnosticKind` type by inlining its three fields
(`name`, `body`, and `suggestion`) into three other diagnostic types:
`Diagnostic`, `DiagnosticMessage`, and `CacheMessage`.

Instead of deferring to an internal `DiagnosticKind`, both `Diagnostic`
and `DiagnosticMessage` now have their own macro-generated `AsRule`
implementations.

This should make both https://github.com/astral-sh/ruff/pull/18051 and
another follow-up PR changing the type of `name` on `CacheMessage`
easier since its type will be able to change separately from
`Diagnostic` and `DiagnosticMessage`.

## Test Plan

Existing tests
2025-05-15 10:27:21 -04:00
Micha Reiser 57617031de
[ty] Enable optimizations for salsa in debug profile (#18117) 2025-05-15 12:31:46 +02:00
Micha Reiser 28b5a868d3
[ty] Enable 'ansi' feature to fix compile error (#18116) 2025-05-15 11:43:15 +02:00
Micha Reiser b6b7caa023
[ty] Change layout of extra verbose output and respect `--color` for verbose output (#18089) 2025-05-15 09:57:59 +02:00
InSync a9f7521944
[ty] Shorten snapshot names (#18039)
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-05-13 18:43:19 +02:00
Micha Reiser c1b875799b
[ty] CLI reference (#17978) 2025-05-09 14:23:24 +02:00
Micha Reiser 6cd8a49638
[ty] Update salsa (#17964) 2025-05-09 11:54:07 +02:00
Micha Reiser 12ce445ff7
[ty] Document configuration schema (#17950) 2025-05-09 10:47:45 +02:00
David Peter 4f890b2867
[ty] Update salsa (#17937)
## Summary

* Update salsa to pull in https://github.com/salsa-rs/salsa/pull/850.
* Some refactoring of salsa event callbacks in various `Db`'s due to
https://github.com/salsa-rs/salsa/pull/849

closes https://github.com/astral-sh/ty/issues/108

## Test Plan

Ran `cargo run --bin ty -- -vvv` on a test file to make sure that salsa
Events are still logged.
2025-05-08 12:02:53 +02:00
Micha Reiser c5e299e796
Update salsa (#17895) 2025-05-07 09:51:15 +02:00
Micha Reiser aa0614509b
Update salsa to pull in fixpoint fixes (#17847) 2025-05-06 11:27:51 +02:00
Aria Desires 784daae497
migrate to dist-workspace.toml, use new workspace.packages config (#17864) 2025-05-05 14:07:46 -04:00
Micha Reiser b51c4f82ea
Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
Micha Reiser a7c358ab5c
[red-knot] Update salsa to prevent panic in custom panic-handler (#17742) 2025-04-30 18:19:07 +02:00
Micha Reiser d94be0e780
[red-knot] Include salsa backtrace in check and mdtest panic messages (#17732)
Co-authored-by: David Peter <sharkdp@users.noreply.github.com>
2025-04-30 10:26:40 +02:00
Micha Reiser 2bb99df394
[red-knot] Update salsa (#17730) 2025-04-30 08:58:31 +02:00
David Peter f0868ac0c9
[red-knot] Revert blanket `clippy::too_many_arguments` allow (#17688)
## Summary

Now that https://github.com/salsa-rs/salsa/issues/808 has been fixed, we
can revert this global change in `Cargo.toml`.
2025-04-28 21:21:53 +02:00
Alex Waygood 1ad5015e19
Upgrade Salsa to a more recent commit (#17678) 2025-04-28 13:32:19 +01:00
renovate[bot] 74081032d9
Update actions/download-artifact digest to d3f86a1 (#17664)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-04-28 10:51:59 +00:00
Aria Desires 775815ef22
Update cargo-dist and apply config improvements (#17453) 2025-04-22 10:05:15 -04:00
David Peter 37a0836bd2
[red-knot] `typing.dataclass_transform` (#17445)
## Summary

* Add initial support for `typing.dataclass_transform`
* Support decorating a function decorator with `@dataclass_transform(…)`
(used by `attrs`, `strawberry`)
* Support decorating a metaclass with `@dataclass_transform(…)` (used by
`pydantic`, but doesn't work yet, because we don't seem to model
`__new__` calls correctly?)
* *No* support yet for decorating base classes with
`@dataclass_transform(…)`. I haven't figured out how this even supposed
to work. And haven't seen it being used.
* Add `strawberry` as an ecosystem project, as it makes heavy use of
`@dataclass_transform`

## Test Plan

New Markdown tests
2025-04-22 10:33:02 +02:00
Andrew Gallant 1d49e71ddd dependencies: switch from `chrono` to `jiff`
We weren't really using `chrono` for anything other than getting the
current time and formatting it for logs.

Unfortunately, this doesn't quite get us to a point where `chrono`
can be removed. From what I can tell, we're still bringing it via
[`tracing-subscriber`](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/)
and
[`quick-junit`](https://docs.rs/quick-junit/latest/quick_junit/).
`tracing-subscriber` does have an
[issue open about Jiff](https://github.com/tokio-rs/tracing/discussions/3128),
but there's no movement on it.

Normally I'd suggest holding off on this since it doesn't get us all of
the way there and it would be better to avoid bringing in two datetime
libraries, but we are, it appears, already there. In particular,
`env_logger` brings in Jiff. So this PR doesn't really make anything
worse, but it does bring us closer to an all-Jiff world.
2025-04-15 07:47:55 -04:00
Carl Meyer fd9882a1f4
[red-knot] avoid unnecessary evaluation of visibility constraint on definitely-unbound symbol (#17326)
This causes spurious query cycles.

This PR also includes an update to Salsa, which gives us db events on
cycle iteration, so we can write tests asserting the absence of a cycle.
2025-04-10 13:59:38 +00:00
Aria Desires 66a33bfd32
update cargo-dist (#17325)
Putting this up to confirm that it does what it should:

* undirty the release.yml by including action-commits in the config
* add persist-credentials=false hardening
2025-04-10 09:43:13 -04:00
Micha Reiser 9f6913c488
[red-knot] Update salsa (#17320)
## Summary

Update Salsa to pull in https://github.com/salsa-rs/salsa/pull/788 which
fixes the, by now, famous *access to field whilst the value is being
initialized*.

This PR also re-enables all tests that previously triggered the panic.

## Test Plan

`cargo test`
2025-04-09 16:22:02 -04:00
Micha Reiser 484a8ed36d
[red-knot] Update salsa (part 1) (#17321) 2025-04-09 19:15:43 +02:00
Aria Desires 8aa5686e63
use astral-sh/cargo-dist instead (#17187) 2025-04-03 17:25:12 -04:00
Micha Reiser e7684d3493
Enable overindented docs lint (#17182)
## Summary

It turns out that `a.` isn't a list format supported by rustdoc. I
changed the documentation to use `1.`, `2.` instead.

## Test Plan

`cargo clippy`
2025-04-03 20:27:11 +01:00
Carl Meyer 45c43735e0
[red-knot] update to latest Salsa with fixpoint caching fix (#17179)
With this PR, we no longer "hang" (not actually a hang, just an
explosion in execution time) when checking pylint.
2025-04-03 09:05:09 -07:00
Micha Reiser 8a4158c5f8
Upgrade to Rust 1.86 and bump MSRV to 1.84 (#17171)
<!--
Thank you for contributing to Ruff! To help us out with reviewing,
please consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

I decided to disable the new
[`needless_continue`](https://rust-lang.github.io/rust-clippy/master/index.html#needless_continue)
rule because I often found the explicit `continue` more readable over an
empty block or having to invert the condition of an other branch.


## Test Plan

`cargo test`

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-04-03 15:59:44 +00:00
Carl Meyer c1f93a702c
[DO NOT LAND] bump Salsa version (#17176)
Update to latest Salsa main branch, so as to get a baseline for
measuring the perf effect of https://github.com/salsa-rs/salsa/pull/786
on red-knot in isolation from other recent changes in Salsa main branch.
2025-04-03 14:31:41 +00:00
Micha Reiser b57c62e6b3
[red-knot] IDE crate (#17045)
## Summary

This PR adds a new but so far empty and unused `red_knot_ide` crate. 

This new crate's purpose is to implement IDE-specific functionality,
such as go to definition, hover, completion, etc., which are used by
both the LSP and the playground.

The crate itself doesn't depend on `lsptypes`. The idea is that the
facade crates (e.g., `red_knot_server`) convert external to internal
types.
Not only allows this to share the logic between server and playground,
it also ensures that the core functionality is easier to test because it
can be tested without needing a full LSP.



## Test Plan

`cargo build`
2025-04-01 09:36:00 +02:00
Dhruv Manilawala f2a9960fb3
Use the Depot Ubuntu runners instead of GitHub for release workflows (#16843)
## Summary

This is same as https://github.com/astral-sh/uv/pull/11948 and is to
prep for the upcoming Ruff release.
2025-03-19 12:42:13 +00:00
Dhruv Manilawala fd341bb1b2
Allow dirty files in `cargo-dist` for action pins (#16842)
## Summary

This is same as https://github.com/astral-sh/uv/pull/12252 and is to
prepare for the upcoming Ruff release.

Upstream issue: https://github.com/axodotdev/cargo-dist/issues/1800
2025-03-19 18:06:53 +05:30
Micha Reiser c100d519e9
[internal]: Upgrade salsa (#16794)
## Summary

Another salsa upgrade. 

The main motivation is to stay on a recent salsa version because there
are still a lot of breaking changes happening.
The most significant changes in this update:

* Salsa no longer derives `Debug` by default. It now requires
`interned(debug)` (or similar)
* This version ships the foundation for garbage collecting interned
values. However, this comes at the cost that queries now track which
interned values they created (or read). The micro benchmarks in the
salsa repo showed a significant perf regression. Will see if this also
visible in our benchmarks.

## Test Plan

`cargo test`
2025-03-17 11:05:54 +01:00
renovate[bot] c61d9c6bb7
Update Rust crate compact_str to 0.9.0 (#16785)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [compact_str](https://redirect.github.com/ParkMyCar/compact_str) |
workspace.dependencies | minor | `0.8.0` -> `0.9.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>ParkMyCar/compact_str (compact_str)</summary>

###
[`v0.9.0`](https://redirect.github.com/ParkMyCar/compact_str/blob/HEAD/CHANGELOG.md#090)

[Compare
Source](https://redirect.github.com/ParkMyCar/compact_str/compare/v0.8.1...v0.9.0)

##### February 24, 2025

#### Breaking Changes 💥

- Removed deprecated methods `CompactString::new_inline(...)` and
`CompactString::from_static_str(...)`.
- Implemented in [`fix: delete methods that are documented as deprecated
in v0.9.0`](https://redirect.github.com/ParkMyCar/compact_str/pull/429)
- Changed the `CompactStringExt::join_compact` and
`CompactStringExt::concat_compact` to take a
reference (i.e. `&C`) to a type `C: IntoIterator<Item = &str>` instead
of ownership of a type `C`
    where `&C: IntoIterator<Item = &str>`.
- Fixed
[`issue#412`](https://redirect.github.com/ParkMyCar/compact_str/issues/412)
which made the
        `CompactStringExt` more ergonomic.
- Implemented in [`feat: tweak the CompactStringExt trait so
join_compact and concat_compact work
better`](https://redirect.github.com/ParkMyCar/compact_str/pull/418)

#### Changes

-   Fixed the `borsch` feature in `no_std` environments.
- Implemented in [`fix: The borsch feature with
no-std`](https://redirect.github.com/ParkMyCar/compact_str/pull/428).
- Implemented the [`zeroize::Zeroize`](https://crates.io/crates/zeroize)
trait for `CompactString`.
- Implemented in [`feat: Add support for
zeroize::Zeroize`](https://redirect.github.com/ParkMyCar/compact_str/pull/421).
- Fixed the `CompactString::retain` method to not set length if the
predicate panics.
- Implemented in [`fix: retain not set len if predicate
panics`](https://redirect.github.com/ParkMyCar/compact_str/pull/413).
-   Implement `sqlx::postgres::PgHasArrayType` for `CompactString`.
- Implemented in [`impl
sqlx::postgres::PgHasArrayType`](https://redirect.github.com/ParkMyCar/compact_str/pull/399).
- Bump the [`markup`](https://crates.io/crates/markup) dependency to
`v0.15`.
- Implemented in [`deps: upgrade to markup
v0.8`](https://redirect.github.com/ParkMyCar/compact_str/pull/415).
- Bump the [`rkyv`](https://crates.io/crates/rkyv) dependency to `v0.8`.
- Implemented in [`deps: upgrade to rkyv
v0.8`](https://redirect.github.com/ParkMyCar/compact_str/pull/409).
- Bump the [`sqlx`](https://crates.io/crates/sqlx) dependency to `v0.8`.
- Implemented in [`deps: upgrade to sqlx
v0.8`](https://redirect.github.com/ParkMyCar/compact_str/pull/408).

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM5LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-03-17 09:08:52 +01:00
renovate[bot] d5e045df47
Update Rust crate etcetera to 0.10.0 (#16786)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [etcetera](https://redirect.github.com/lunacookies/etcetera) |
workspace.dependencies | minor | `0.8.0` -> `0.10.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>lunacookies/etcetera (etcetera)</summary>

###
[`v0.10.0`](https://redirect.github.com/lunacookies/etcetera/releases/tag/v0.10.0)

[Compare
Source](https://redirect.github.com/lunacookies/etcetera/compare/v0.9.0...v0.10.0)

#### What's Changed

- Allow compatibility with recent versions of home in
[https://github.com/lunacookies/etcetera/pull/31](https://redirect.github.com/lunacookies/etcetera/pull/31)
- Support non-UTF8 dirs in
[https://github.com/lunacookies/etcetera/pull/32](https://redirect.github.com/lunacookies/etcetera/pull/32)
- Add note about MSRV & fix CI in
[https://github.com/lunacookies/etcetera/pull/33](https://redirect.github.com/lunacookies/etcetera/pull/33)

This version raises MSRV to 1.81.0. But if you pin `home` to `<0.5.11`
in `Cargo.lock`, then the MSRV will be `1.70.0`.

**Full Changelog**:
https://github.com/lunacookies/etcetera/compare/v0.9.0...v0.10.0

###
[`v0.9.0`](https://redirect.github.com/lunacookies/etcetera/releases/tag/v0.9.0)

[Compare
Source](https://redirect.github.com/lunacookies/etcetera/compare/v0.8.0...v0.9.0)

#### What's Changed

- Make macOS bundle ID match the directories crate in
[https://github.com/lunacookies/etcetera/pull/22](https://redirect.github.com/lunacookies/etcetera/pull/22)
- Make the traits dyn-compatible in
[https://github.com/lunacookies/etcetera/pull/25](https://redirect.github.com/lunacookies/etcetera/pull/25)
- windows-sys: bump & replace SHGetFolderPathW with SHGetKnownFolderPath
in
[https://github.com/lunacookies/etcetera/pull/30](https://redirect.github.com/lunacookies/etcetera/pull/30)
- crate: bump to edition 2021 & raise MSRV to 1.70.0 in
[https://github.com/lunacookies/etcetera/pull/30](https://redirect.github.com/lunacookies/etcetera/pull/30)

**Full Changelog**:
https://github.com/lunacookies/etcetera/compare/v0.8.0...v0.9.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4yMDAuMCIsInVwZGF0ZWRJblZlciI6IjM5LjIwMC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 07:52:58 +00:00
Micha Reiser 595565015b
Fallback to requires-python in certain cases when target-version is not found (#16721)
## Summary

Restores https://github.com/astral-sh/ruff/pull/16319 after it got
dropped from the 0.10 release branch :(

---------

Co-authored-by: dylwil3 <dylwil3@gmail.com>
2025-03-14 09:36:51 +01:00
Carl Meyer a176c1ac80
[red-knot] use fixpoint iteration for all cycles (#14029)
Pulls in the latest Salsa main branch, which supports fixpoint
iteration, and uses it to handle all query cycles.

With this, we no longer need to skip any corpus files to avoid panics.

Latest perf results show a 6% incremental and 1% cold-check regression.
This is not a "no cycles" regression, as tomllib and typeshed do trigger
some definition cycles (previously handled by our old
`infer_definition_types` fallback to `Unknown`). We don't currently have
a benchmark we can use to measure the pure no-cycles regression, though
I expect there would still be some regression; the fixpoint iteration
feature in Salsa does add some overhead even for non-cyclic queries.

I think this regression is within the reasonable range for this feature.
We can do further optimization work later, but I don't think it's the
top priority right now. So going ahead and acknowledging the regression
on CodSpeed.

Mypy primer is happy, so this doesn't regress anything on our
currently-checked projects. I expect it probably unlocks adding a number
of new projects to our ecosystem check that previously would have
panicked.

Fixes #13792
Fixes #14672
2025-03-12 12:41:40 +00:00
Micha Reiser c892fee058
[red-knot] Upgrade salsa to include `AtomicPtr` perf improvement (#16398) 2025-02-26 17:02:06 +01:00
Carl Meyer dd6f6233bd
bump MSRV to 1.83 (#16294)
According to our new MSRV policy (see
https://github.com/astral-sh/ruff/issues/16370 ), bump our MSRV to 1.83
(N - 2), and autofix some new clippy lints.
2025-02-26 06:12:43 -08:00
Micha Reiser 81a57656d8
Update Salsa (#16338) 2025-02-24 09:44:19 +01:00
Micha Reiser 5eaf225fc3
Update Salsa part 1 (#16340) 2025-02-24 09:35:21 +01:00
Carl Meyer 4d63c16c19
[red-knot] update to latest Salsa (#16293)
Update to latest Salsa main branch. This provides a point of comparison
for the perf impact of fixpoint iteration, which is based on latest
Salsa main.

This requires an update to the locked version of our boxcar dep, since
Salsa now depends on a newer version of boxcar.
2025-02-20 18:15:58 -08:00
Ibraheem Ahmed 69d86d1d69
Transition to salsa coarse-grained tracked structs (#15763)
## Summary

Transition to using coarse-grained tracked structs (depends on
https://github.com/salsa-rs/salsa/pull/657). For now, this PR doesn't
add any `#[tracked]` fields, meaning that any changes cause the entire
struct to be invalidated. It also changes `AstNodeRef` to be
compared/hashed by pointer address, instead of performing a deep AST
comparison.

## Test Plan

This yields a 10-15% improvement on my machine (though weirdly some runs
were 5-10% without being flagged as inconsistent by criterion, is there
some non-determinism involved?). It's possible that some of this is
unrelated, I'll try applying the patch to the current salsa version to
make sure.

---------

Co-authored-by: Micha Reiser <micha@reiser.io>
2025-02-11 11:38:50 +01:00
renovate[bot] 5e1403a8a6
Update Rust crate strum_macros to 0.27.0 (#16065) 2025-02-10 02:36:08 +00:00
renovate[bot] 81749164bc
Update Rust crate strum to 0.27.0 (#16064) 2025-02-09 21:29:20 -05:00
renovate[bot] 638186afbd
Update Rust crate rand to 0.9.0 (#15899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-02-03 12:25:57 +01:00
Micha Reiser 770b7f3439
Vendor benchmark test files (#15878)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2025-02-02 18:16:07 +00:00
Micha Reiser d70d959612
Rename `red_knot_workspace` to `red_knot_project` (#15615) 2025-01-20 14:02:36 +01:00
renovate[bot] 36c90ebe86
Update Rust crate notify to v8 (#15435)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [notify](https://redirect.github.com/notify-rs/notify) |
workspace.dependencies | major | `7.0.0` -> `8.0.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>notify-rs/notify (notify)</summary>

###
[`v8.0.0`](https://redirect.github.com/notify-rs/notify/blob/HEAD/CHANGELOG.md#notify-800-2025-01-10)

[Compare
Source](https://redirect.github.com/notify-rs/notify/compare/notify-7.0.0...notify-8.0.0)

-   CHANGE: update notify-types to version 2.0.0
-   CHANGE: raise MSRV to 1.77 **breaking**
- FEATURE: add config option to disable following symbolic links
[#&#8203;635]
- FIX: unaligned access to FILE_NOTIFY_INFORMATION [#&#8203;647]
**breaking**

[#&#8203;635]: https://redirect.github.com/notify-rs/notify/pull/635

[#&#8203;647]: https://redirect.github.com/notify-rs/notify/pull/647

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-20 10:41:16 +01:00
Andrew Gallant 84179aaa96 ruff_linter,ruff_python_parser: migrate to updated `annotate-snippets`
This is pretty much just moving to the new API and taking care to use
byte offsets. This is *almost* enough. The next commit will fix a bug
involving the handling of unprintable characters as a result of
switching to byte offsets.
2025-01-15 13:37:52 -05:00
Andrew Gallant 9c27c57b5b crates: vendor `annotate-snippets` crate
This merely adds the crate to our repository. Some cosmetic changes are
made to make it work in our repo and follow our conventions, such as
changing the name to `ruff_annotate_snippets`. We retain the original
license information. We do drop some things, such as benchmarks, but
keep tests and examples.
2025-01-15 13:37:52 -05:00
renovate[bot] 60d7a464fb
Update Rust crate colored to v3 (#15434)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-11 17:52:52 +00:00
Micha Reiser c39ca8fe6d
Upgrade Rust toolchain to 1.84.0 (#15408) 2025-01-11 09:51:58 +01:00
renovate[bot] e5270e2ac2
Update Rust crate itertools to 0.14.0 (#15287)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2025-01-06 07:55:32 +00:00
renovate[bot] bd02beec85
Update Rust crate clearscreen to v4 (#15288) 2025-01-05 20:06:13 -05:00
Micha Reiser baf0d660eb
Update salsa (#15243) 2025-01-03 20:04:35 +01:00
Micha Reiser 80577a49f8
Upgrade salsa in fuzzer script (#15040) 2024-12-17 18:01:58 +01:00
Micha Reiser c3b6139f39
Upgrade salsa (#15039)
The only code change is that Salsa now requires the `Db` to implement
`Clone` to create "lightweight" snapshots.
2024-12-17 15:50:33 +00:00
renovate[bot] 8f04202ee4
Update Rust crate dir-test to 0.4.0 (#14578)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-25 08:36:06 +01:00
Zanie Blue 70d9c90827 Use XDG (i.e. `~/.local/bin`) instead of the Cargo home directory in the installer (#14457)
Closes https://github.com/astral-sh/ruff/issues/13927
2024-11-20 13:11:51 +01:00
Zanie Blue 844c07f1f0 Upgrade cargo-dist from 0.22.1 => 0.25.2-prerelease.3 (#14456)
Needed to prevent updater failures when doing
https://github.com/astral-sh/ruff/issues/13927

See 

- https://github.com/axodotdev/axoupdater/issues/210
- https://github.com/axodotdev/cargo-dist/pull/1538
- https://github.com/astral-sh/uv/pull/8958
2024-11-20 13:11:51 +01:00
renovate[bot] 8c3c5ee5e3 Update Rust crate unicode-width to 0.2.0 (#13473)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-20 13:11:51 +01:00
konsti b46cc6ac0b Update pyproject-toml to support PEP 639 (#13902)
Fixes #13869
2024-11-20 13:11:51 +01:00
Micha Reiser 81e5830585
Workspace discovery (#14308) 2024-11-15 19:20:15 +01:00
renovate[bot] e947d163b2
Update Rust crate thiserror to v2 (#14262)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2024-11-11 09:46:09 +00:00
Alex Waygood df45a0e3f9
[red-knot] Add MRO resolution for classes (#14027) 2024-11-04 13:31:38 +00:00
renovate[bot] a6f7f22b27
Update Rust crate notify to v7 (#14083) 2024-11-04 07:39:06 +01:00
Alex Waygood e6dcdf3e49
Switch off the `single_match_else` Clippy lint (#13994) 2024-10-30 12:24:16 +00:00
Micha Reiser 32b57b2ee4
Enable nursery rules: 'redundant_clone', 'debug_assert_with_mut_call', and 'unused_peekable' (#13920) 2024-10-25 09:46:30 +02:00
Micha Reiser 9e3cf14dde
Speed up mdtests (#13832)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-21 20:06:41 +01:00
renovate[bot] 19a2fd1c82
Update Rust crate fern to 0.7.0 (#13844) 2024-10-21 01:51:49 +00:00
Aditya Pratap Singh 7fd8e30eed
[red-knot] Cleanup generated names of mdtest tests (#13831)
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2024-10-20 15:11:53 +00:00
renovate[bot] 7ca3571194
Update Rust crate pep440_rs to 0.7.1 (#13654)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Micha Reiser <micha@reiser.io>
2024-10-20 11:52:55 +02:00