Micha Reiser
a56ee9268e
Add mdtest support for files with invalid syntax ( #14126 )
2024-11-06 12:25:52 +01:00
Dhruv Manilawala
4ece8e5c1e
Use "Ruff" instead of "uv" for src
setting docs ( #14121 )
...
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary
From
15aa5a6d57
2024-11-06 03:19:32 +00:00
Dhruv Manilawala
34b6a9b909
Remove unpack
field from SemanticIndexBuilder
( #14101 )
...
## Summary
Related to
https://github.com/astral-sh/ruff/pull/13979#discussion_r1828305790 ,
this PR removes the `current_unpack` state field from
`SemanticIndexBuilder` and passes the `Unpack` ingredient via the
`CurrentAssignment` -> `DefinitionNodeRef` conversion to finally store
it on `DefintionNodeKind`.
This involves updating the lifetime of `AnyParameterRef` (parameter to
`declare_parameter`) to use the `'db` lifetime. Currently, all AST nodes
stored on various enums are marked with `'a` lifetime but they're always
utilized using the `'db` lifetime.
This also removes the dedicated `'a` lifetime parameter on
`add_definition` which is currently being used in `DefinitionNodeRef`.
As mentioned, all AST nodes live through the `'db` lifetime so we can
remove the `'a` lifetime parameter from that method and use the `'db`
lifetime instead.
2024-11-06 08:42:58 +05:30
Alex Waygood
eead549254
[red-knot] Introduce a new ClassLiteralType
struct ( #14108 )
2024-11-05 22:16:33 +00:00
Lokejoke
abafeb4bee
Fix: Recover boolean test flag after visiting subexpressions ( #13909 )
...
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo shear (push) Blocked by required conditions
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
Co-authored-by: xbrtnik1 <524841@mail.muni.cz>
2024-11-05 20:55:49 +01:00
Dylan
2b76fa8fa1
[refurb] Parse more exotic decimal strings in verbose-decimal-constructor (FURB157)
( #14098 )
...
FURB157 suggests replacing expressions like `Decimal("123")` with
`Decimal(123)`. This PR extends the rule to cover cases where the input
string to `Decimal` can be easily transformed into an integer literal.
For example:
```python
Decimal("1__000") # fix: `Decimal(1000)`
```
Note: we do not implement the full decimal parsing logic from CPython on
the grounds that certain acceptable string inputs to the `Decimal`
constructor may be presumed purposeful on the part of the developer. For
example, as in the linked issue, `Decimal("١٢٣")` is valid and equal to
`Decimal(123)`, but we do not suggest a replacement in this case.
Closes #13807
2024-11-05 13:33:04 -06:00
David Peter
239cbc6f33
[red-knot] Store starred-expression annotation types ( #14106 )
...
## Summary
- Store the expression type for annotations that are starred expressions
(see [discussion
here](https://github.com/astral-sh/ruff/pull/14091#discussion_r1828332857 ))
- Use `self.store_expression_type(…)` consistently throughout, as it
makes sure that no double-insertion errors occur.
closes #14115
## Test Plan
Added an invalid-syntax example to the corpus which leads to a panic on
`main`. Also added a Markdown test with a valid-syntax example that
would lead to a panic once we implement function parameter inference.
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-05 20:25:45 +01:00
David Peter
2296627528
[red-knot] Precise inference for identity checks ( #14109 )
...
## Summary
Adds more precise type inference for `… is …` and `… is not …` identity
checks in some limited cases where we statically know the answer to be
either `Literal[True]` or `Literal[False]`.
I found this helpful while working on type inference for comparisons
involving intersection types, but I'm not sure if this is at all useful
for real world code (where the answer is most probably *not* statically
known). Note that we already have *type narrowing* for identity tests.
So while we are already able to generate constraints for things like `if
x is None`, we can now — in some limited cases — make an even stronger
conclusion and infer that the test expression itself is `Literal[False]`
(branch never taken) or `Literal[True]` (branch always taken).
## Test Plan
New Markdown tests
2024-11-05 19:48:52 +01:00
Micha Reiser
05687285fe
fix double inference of standalone expressions ( #14107 )
2024-11-05 15:50:31 +01:00
Alex Waygood
05f97bae73
types.rs
: remove unused is_stdlib_symbol
methods (#14104 )
CI / cargo test (windows) (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
2024-11-05 12:46:17 +00:00
Micha Reiser
4323512a65
Remove AST-node dependency from FunctionType
and ClassType
( #14087 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-05 08:02:38 +00:00
Shaygan Hooshyari
9dddd73c29
[red-knot] Literal special form ( #13874 )
...
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
Handling `Literal` type in annotations.
Resolves : #13672
## Implementation
Since Literals are not a fully defined type in typeshed. I used a trick
to figure out when a special form is a literal.
When we are inferring assignment types I am checking if the type of that
assignment was resolved to typing.SpecialForm and the name of the target
is `Literal` if that is the case then I am re creating a new instance
type and set the known instance field to `KnownInstance:Literal`.
**Why not defining a new type?**
From this [issue](https://github.com/python/typeshed/issues/6219 ) I
learned that we want to resolve members to SpecialMethod class. So if we
create a new instance here we can rely on the member resolving in that
already exists.
## Tests
https://typing.readthedocs.io/en/latest/spec/literal.html#equivalence-of-two-literals
Since the type of the value inside Literal is evaluated as a
Literal(LiteralString, LiteralInt, ...) then the equality is only true
when types and value are equal.
https://typing.readthedocs.io/en/latest/spec/literal.html#legal-and-illegal-parameterizations
The illegal parameterizations are mostly implemented I'm currently
checking the slice expression and the slice type to make sure it's
valid.
https://typing.readthedocs.io/en/latest/spec/literal.html#shortening-unions-of-literals
---------
Co-authored-by: Carl Meyer <carl@astral.sh>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-05 01:45:46 +00:00
TomerBin
6c56a7a868
[red-knot] Implement type narrowing for boolean conditionals ( #14037 )
...
## Summary
This PR enables red-knot to support type narrowing based on `and` and
`or` conditionals, including nested combinations and their negation (for
`elif` / `else` blocks and for `not` operator). Part of #13694 .
In order to address this properly (hopefully 😅 ), I had to run
`NarrowingConstraintsBuilder` functions recursively. In the first commit
I introduced a minor refactor - instead of mutating `self.constraints`,
the new constraints are now returned as function return values. I also
modified the constraints map to be optional, preventing unnecessary
hashmap allocations.
Thanks @carljm for your support on this :)
The second commit contains the logic and tests for handling boolean ops,
with improvements to intersections handling in `is_subtype_of` .
As I'm still new to Rust and the internals of type checkers, I’d be more
than happy to hear any insights or suggestions.
Thank you!
---------
Co-authored-by: Carl Meyer <carl@astral.sh>
2024-11-04 22:54:35 +00:00
InSync
bb25bd9c6c
Also remove trailing comma while fixing C409 and C419 ( #14097 )
2024-11-04 20:33:30 +00:00
Simon Brugman
b7e32b0a18
Re-enable clippy useless-format
( #14095 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo shear (push) Blocked by required conditions
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
2024-11-04 18:25:25 +01:00
Simon Brugman
fb94b71e63
Derive message formats macro support to string ( #14093 )
2024-11-04 18:06:25 +01:00
Micha Reiser
bc0586d922
Avoid cloning Name
when looking up function and class types ( #14092 )
2024-11-04 15:52:59 +01:00
Simon Brugman
a7a78f939c
Replace format!
without parameters with .to_string()
( #14090 )
...
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-11-04 14:09:30 +00:00
David Peter
6dabf045c3
[red-knot] Do not panic when encountering string annotations ( #14091 )
...
## Summary
Encountered this while running red-knot benchmarks on the `black`
codebase.
Fixes two of the issues in #13478 .
## Test Plan
Added a regression test.
2024-11-04 15:06:54 +01:00
Alex Waygood
df45a0e3f9
[red-knot] Add MRO resolution for classes ( #14027 )
2024-11-04 13:31:38 +00:00
David Peter
88d9bb191b
[red-knot] Remove Type::None
( #14024 )
...
## Summary
Removes `Type::None` in favor of `KnownClass::NoneType.to_instance(…)`.
closes #13670
## Performance
There is a -4% performance regression on our red-knot benchmark. This is due to the fact that we now have to import `_typeshed` as a module, and infer types.
## Test Plan
Existing tests pass.
2024-11-04 14:00:05 +01:00
Dhruv Manilawala
e302c2de7c
Cached inference of all definitions in an unpacking ( #13979 )
...
CI / cargo test (windows) (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary
This PR adds a new salsa query and an ingredient to resolve all the
variables involved in an unpacking assignment like `(a, b) = (1, 2)` at
once. Previously, we'd recursively try to match the correct type for
each definition individually which will result in creating duplicate
diagnostics.
This PR still doesn't solve the duplicate diagnostics issue because that
requires a different solution like using salsa accumulator or
de-duplicating the diagnostics manually.
Related: #13773
## Test Plan
Make sure that all unpack assignment test cases pass, there are no
panics in the corpus tests.
## Todo
- [x] Look at the performance regression
2024-11-04 17:11:57 +05:30
renovate[bot]
012f385f5d
Update dependency uuid to v11 ( #14084 )
...
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 08:09:18 +01:00
renovate[bot]
a6f7f22b27
Update Rust crate notify to v7 ( #14083 )
2024-11-04 07:39:06 +01:00
renovate[bot]
8d7dda9fb7
Update cloudflare/wrangler-action action to v3.11.0 ( #14080 )
...
CI / test scripts (push) Blocked by required conditions
CI / cargo clippy (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
|
[cloudflare/wrangler-action](https://redirect.github.com/cloudflare/wrangler-action )
| action | minor | `v3.9.0` -> `v3.11.0` |
---
### Release Notes
<details>
<summary>cloudflare/wrangler-action
(cloudflare/wrangler-action)</summary>
###
[`v3.11.0`](https://redirect.github.com/cloudflare/wrangler-action/releases/tag/v3.11.0 )
[Compare
Source](https://redirect.github.com/cloudflare/wrangler-action/compare/v3.10.0...v3.11.0 )
##### Minor Changes
-
[#​309](https://redirect.github.com/cloudflare/wrangler-action/pull/309 )
[`10d5b9c1c1826adaec0a9ee49fdf5b91113508ef`](10d5b9c1c1
)
Thanks [@​Maximo-Guk](https://redirect.github.com/Maximo-Guk )! -
Revert "Add parity with pages-action for pages deploy outputs"
###
[`v3.10.0`](https://redirect.github.com/cloudflare/wrangler-action/releases/tag/v3.10.0 )
[Compare
Source](https://redirect.github.com/cloudflare/wrangler-action/compare/v3.9.0...v3.10.0 )
##### Minor Changes
-
[#​303](https://redirect.github.com/cloudflare/wrangler-action/pull/303 )
[`3ec7f8943ef83351f743cfaa8763a9056ef70993`](3ec7f8943e
)
Thanks
[@​courtney-sims](https://redirect.github.com/courtney-sims )! -
Support id, environment, url, and alias outputs for Pages deploys.
</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:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNCIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 08:44:06 +05:30
renovate[bot]
fb0881d836
Update dependency mdformat-mkdocs to v3.1.1 ( #14081 )
...
This PR contains the following updates:
| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[mdformat-mkdocs](https://redirect.github.com/kyleking/mdformat-mkdocs )
([changelog](https://redirect.github.com/kyleking/mdformat-mkdocs/releases ))
| `==3.0.1` -> `==3.1.1` |
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
[](https://docs.renovatebot.com/merge-confidence/ )
|
---
### Release Notes
<details>
<summary>kyleking/mdformat-mkdocs (mdformat-mkdocs)</summary>
###
[`v3.1.1`](https://redirect.github.com/KyleKing/mdformat-mkdocs/releases/tag/v3.1.1 )
[Compare
Source](https://redirect.github.com/kyleking/mdformat-mkdocs/compare/v3.1.0...v3.1.1 )
**Full Changelog**:
https://github.com/KyleKing/mdformat-mkdocs/compare/v3.1.0...v3.1.1
###
[`v3.1.0`](https://redirect.github.com/kyleking/mdformat-mkdocs/compare/v3.0.1...v3.1.0 )
[Compare
Source](https://redirect.github.com/kyleking/mdformat-mkdocs/compare/v3.0.1...v3.1.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:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNCIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 08:37:53 +05:30
renovate[bot]
ded2b15e05
Update pre-commit dependencies ( #14082 )
...
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
|
[abravalheri/validate-pyproject](https://redirect.github.com/abravalheri/validate-pyproject )
| repository | minor | `v0.21` -> `v0.22` |
|
[astral-sh/ruff-pre-commit](https://redirect.github.com/astral-sh/ruff-pre-commit )
| repository | patch | `v0.7.0` -> `v0.7.2` |
| [crate-ci/typos](https://redirect.github.com/crate-ci/typos ) |
repository | minor | `v1.26.0` -> `v1.27.0` |
Note: The `pre-commit` manager in Renovate is not supported by the
`pre-commit` maintainers or community. Please do not report any problems
there, instead [create a Discussion in the Renovate
repository](https://redirect.github.com/renovatebot/renovate/discussions/new )
if you have any questions.
---
### Release Notes
<details>
<summary>abravalheri/validate-pyproject
(abravalheri/validate-pyproject)</summary>
###
[`v0.22`](https://redirect.github.com/abravalheri/validate-pyproject/releases/tag/v0.22 )
[Compare
Source](https://redirect.github.com/abravalheri/validate-pyproject/compare/v0.21...v0.22 )
#### What's Changed
- Prevent injecting defaults and modifying input in-place, by
[@​henryiii](https://redirect.github.com/henryiii ) in
[https://github.com/abravalheri/validate-pyproject/pull/213 ](https://redirect.github.com/abravalheri/validate-pyproject/pull/213 )
**Full Changelog**:
https://github.com/abravalheri/validate-pyproject/compare/v0.21...v0.22
</details>
<details>
<summary>astral-sh/ruff-pre-commit (astral-sh/ruff-pre-commit)</summary>
###
[`v0.7.2`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.7.2 )
[Compare
Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.7.1...v0.7.2 )
See: https://github.com/astral-sh/ruff/releases/tag/0.7.2
###
[`v0.7.1`](https://redirect.github.com/astral-sh/ruff-pre-commit/releases/tag/v0.7.1 )
[Compare
Source](https://redirect.github.com/astral-sh/ruff-pre-commit/compare/v0.7.0...v0.7.1 )
See: https://github.com/astral-sh/ruff/releases/tag/0.7.1
</details>
<details>
<summary>crate-ci/typos (crate-ci/typos)</summary>
###
[`v1.27.0`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.27.0 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.8...v1.27.0 )
#### \[1.27.0] - 2024-11-01
##### Features
- Updated the dictionary with the [October
2024](https://redirect.github.com/crate-ci/typos/issues/1106 ) changes
###
[`v1.26.8`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.26.8 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.7...v1.26.8 )
#### \[1.26.8] - 2024-10-24
###
[`v1.26.7`](https://redirect.github.com/crate-ci/typos/compare/v1.26.6...v1.26.7 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.6...v1.26.7 )
###
[`v1.26.6`](https://redirect.github.com/crate-ci/typos/compare/v1.26.5...v1.26.6 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.5...v1.26.6 )
###
[`v1.26.5`](https://redirect.github.com/crate-ci/typos/compare/v1.26.4...v1.26.5 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.4...v1.26.5 )
###
[`v1.26.4`](https://redirect.github.com/crate-ci/typos/compare/v1.26.3...v1.26.4 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.3...v1.26.4 )
###
[`v1.26.3`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.26.3 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.2...v1.26.3 )
#### \[1.26.3] - 2024-10-24
##### Fixes
- Accept `additionals`
###
[`v1.26.2`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.26.2 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.1...v1.26.2 )
#### \[1.26.2] - 2024-10-24
##### Fixes
- Accept `tesselate` variants
###
[`v1.26.1`](https://redirect.github.com/crate-ci/typos/releases/tag/v1.26.1 )
[Compare
Source](https://redirect.github.com/crate-ci/typos/compare/v1.26.0...v1.26.1 )
#### \[1.26.1] - 2024-10-23
##### Fixes
- Respect `--force-exclude` for binary files
</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.
👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions ) if
that's undesired.
---
- [ ] <!-- 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:eyJjcmVhdGVkSW5WZXIiOiIzOC4xNDIuNCIsInVwZGF0ZWRJblZlciI6IjM4LjE0Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJpbnRlcm5hbCJdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-04 08:35:31 +05:30
renovate[bot]
3133964d8c
Update dependency ruff to v0.7.2 ( #14077 )
2024-11-03 21:16:28 -05:00
renovate[bot]
f00039b6f2
Update NPM Development dependencies ( #14078 )
2024-11-03 21:16:22 -05:00
renovate[bot]
6ccd0f187b
Update Rust crate thiserror to v1.0.67 ( #14076 )
2024-11-03 21:16:13 -05:00
renovate[bot]
de40f6a3ad
Update Rust crate syn to v2.0.87 ( #14075 )
2024-11-03 21:16:08 -05:00
renovate[bot]
dfbd27dc2f
Update Rust crate serde to v1.0.214 ( #14074 )
2024-11-03 21:16:02 -05:00
renovate[bot]
1531ca8a1b
Update Rust crate pep440_rs to v0.7.2 ( #14073 )
2024-11-03 21:15:56 -05:00
renovate[bot]
71702bbd48
Update Rust crate insta to v1.41.1 ( #14072 )
2024-11-03 21:15:49 -05:00
renovate[bot]
8d9bdb5b92
Update Rust crate anyhow to v1.0.92 ( #14071 )
2024-11-03 21:15:42 -05:00
Fábio D. Batista
2b73a1c039
[eradicate
] ignore # language=
in commented-out-code rule (ERA001) ( #14069 )
...
## Summary
The `commented-out-code` rule (ERA001) from `eradicate` is currently
flagging a very common idiom that marks Python strings as another
language, to help with syntax highlighting:

This PR adds this idiom to the list of allowed exceptions to the rule.
## Test Plan
I've added some additional test cases.
2024-11-03 16:50:00 -05:00
Charlie Marsh
2b0cdd2338
Improve some rule messages and docs ( #14068 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
2024-11-03 19:25:43 +00:00
Charlie Marsh
f09dc8b67c
Detect items that hash to same value in duplicate dictionaries ( #14065 )
...
## Summary
Closes https://github.com/astral-sh/ruff/issues/12772 .
2024-11-03 14:16:34 -05:00
Charlie Marsh
71a122f060
Allow open
without context manager in return
statement ( #14066 )
...
## Summary
Closes https://github.com/astral-sh/ruff/issues/13862 .
2024-11-03 14:16:27 -05:00
Matt Norton
3ca24785ae
Add links to missing related options within rule documentations ( #13971 )
...
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-03 14:15:57 -05:00
Charlie Marsh
1de36cfe4c
Fix wrong-size header in open-file-with-context-handler
( #14067 )
2024-11-03 19:06:40 +00:00
Charlie Marsh
66872a41fc
Detect items that hash to same value in duplicate sets ( #14064 )
...
## Summary
Like https://github.com/astral-sh/ruff/pull/14063 , but ensures that we
catch cases like `{1, True}` in which the items hash to the same value
despite not being identical.
2024-11-03 18:49:11 +00:00
Charlie Marsh
e00594e8d2
Respect hash-equivalent literals in iteration-over-set
( #14063 )
...
## Summary
Closes https://github.com/astral-sh/ruff/issues/14049 .
2024-11-03 18:44:52 +00:00
Micha Reiser
443fd3b660
Disallow single-line implicit concatenated strings ( #13928 )
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
2024-11-03 11:49:26 +00:00
Steve C
ae9f08d1e5
[ruff
] - fix false positive for decorators (RUF028
) ( #14061 )
2024-11-03 11:49:03 +00:00
Steve C
f69712c11d
[flake8-pyi
] - include all python file types for PYI006
and PYI066
( #14059 )
2024-11-03 11:47:36 +00:00
Steve C
be485602de
Fix preview link references in 2 rule docs ( #14060 )
2024-11-03 11:45:35 +00:00
Steve C
bc7615af0e
[flake8-bugbear
] - do not run mutable-argument-default
on stubs (B006
) ( #14058 )
...
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz (push) Blocked by required conditions
CI / Fuzz the parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary
Early-exits in `B006` when the file is a stub. Fixes #14026
## Test Plan
`cargo test`
2024-11-02 22:48:48 -04:00
Charlie Marsh
4a3eeeff86
Remove HashableExpr
abstraction ( #14057 )
...
## Summary
It looks like `ComparableExpr` now implements `Hash` so we can just
remove this.
2024-11-02 20:28:35 +00:00
Charlie Marsh
35c6dfe481
Avoid parsing joint rule codes as distinct codes in # noqa
( #12809 )
...
## Summary
We should enable warnings for unsupported codes, but this at least fixes
the parsing for `# noqa: F401F841`.
Closes https://github.com/astral-sh/ruff/issues/12808 .
2024-11-02 20:24:59 +00:00