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 )
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 )
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 )
...
## 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
Simon Brugman
f8374280c0
[`flake8-simplify`] Implementation for `split-of-static-string` (SIM905) ( #14008 )
...
## Summary
Closes https://github.com/astral-sh/ruff/issues/13944
## Test Plan
Standard snapshot testing
flake8-simplify surprisingly only has a single test case
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-02 17:15:36 +00:00
Steve C
0925513529
[`pyupgrade`] - ignore kwarg unpacking for `UP044` ( #14053 )
...
## Summary
Fixes #14047
## Test Plan
`catgo test`
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-02 13:10:56 -04:00
Charlie Marsh
70bdde4085
Handle unions in augmented assignments ( #14045 )
...
## Summary
Removing more TODOs from the augmented assignment test suite. Now, if
the _target_ is a union, we correctly infer the union of results:
```python
if flag:
f = Foo()
else:
f = 42.0
f += 12
```
2024-11-01 19:49:18 +00:00
TomerBin
34a5d7cb7f
[red-knot] Infer type of if-expression if test has statically known truthiness ( #14048 )
...
## Summary
Detecting statically known truthy or falsy test in if expressions
(ternary).
## Test Plan
new mdtest
2024-11-01 12:23:18 -07:00
Charlie Marsh
487941ea66
Handle maybe-unbound `__iadd__`-like operators in augmented assignments ( #14044 )
...
## Summary
One of the follow-ups from augmented assignment inference, now that
`Type::Unbound` has been removed.
---------
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-11-01 13:15:35 -04:00
Harry Reeder
099f077311
[docs] Add rule short code to mkdocs tags ( #14040 )
...
## Summary
<!-- What's the purpose of the change? What does it do, and why? -->
This PR updates the metadata in the YAML frontmatter of the mkdocs
documentation to include the rule short code as a tag, so it can be
easily searched.
Ref: #13684
## Test Plan
<!-- How was it tested? -->
This has been tested locally using the documentation provided
[here](https://docs.astral.sh/ruff/contributing/#mkdocs ) for generating
docs.
This generates docs that now have the tags section:
```markdown
---
description: Checks for abstract classes without abstract methods.
tags:
- B024
---
# abstract-base-class-without-abstract-method (B024)
... trimmed
```
I've also verified that this gives the ability to get straight to the
page via search when serving mkdocs locally.
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2024-11-01 15:50:12 +00:00
Micha Reiser
8574751911
Give non-existent files a durability of at least Medium ( #14034 )
2024-11-01 16:44:30 +01:00
Dhruv Manilawala
ddae741b72
Switch to `uv publish` ( #14042 )
...
## Summary
Ref: https://github.com/astral-sh/uv/pull/8065
## Test Plan
Going to re-release `0.7.2` which failed:
https://github.com/astral-sh/ruff/actions/runs/11630280069
2024-11-01 20:24:29 +05:30
Simon Brugman
5053d2c127
Doc: markdown link fix ( #14041 )
...
Typo in `mutable-contextvar-default` in `flake8-bugbear`
2024-11-01 14:19:00 +00:00
Dhruv Manilawala
ef72fd79a7
Bump version to 0.7.2 ( #14039 )
2024-11-01 19:09:07 +05:30
STACIA
658a51ea10
Fix typo for static method decorator ( #14038 )
2024-11-01 12:30:50 +00:00
github-actions[bot]
7c2da4f06e
Sync vendored typeshed stubs ( #14030 )
...
Co-authored-by: typeshedbot <>
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
2024-11-01 10:51:56 +00:00
Micha Reiser
48fa839c80
Use named function in incremental red knot benchmark ( #14033 )
2024-11-01 08:44:38 +00:00
Micha Reiser
cf0f5e1318
Fix formatting of single with-item with trailing comment ( #14005 )
2024-11-01 09:08:06 +01:00
Micha Reiser
20b8a43017
Fix server panic when undoing an edit ( #14010 )
2024-11-01 08:16:53 +01:00
Carl Meyer
b8acadd6a2
[red-knot] have mdformat wrap mdtest files to 100 columns ( #14020 )
...
This makes it easier to read and edit (and review changes to) these
files as source, even though it doesn't affect the rendering.
2024-10-31 21:00:51 +00:00
David Peter
b372fe7198
[red-knot] Add myself as red-knot codeowner ( #14023 )
2024-10-31 19:17:37 +00:00
David Peter
53fa32a389
[red-knot] Remove `Type::Unbound` ( #13980 )
...
<!--
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
- Remove `Type::Unbound`
- Handle (potential) unboundness as a concept orthogonal to the type
system (see new `Symbol` type)
- Improve existing and add new diagnostics related to (potential)
unboundness
closes #13671
## Test Plan
- Update existing markdown-based tests
- Add new tests for added/modified functionality
2024-10-31 20:05:53 +01:00
Alex Waygood
d1189c20df
[red-knot] Add failing tests for iterating over maybe-iterable unions ( #14016 )
2024-10-31 18:20:21 +00:00
Simon Brugman
9a6b08b557
[`flake8-simplify`] Include caveats of enabling `if-else-block-instead-of-if-exp` (SIM108) ( #14019 )
2024-10-31 17:26:22 +00:00
Micha Reiser
76e4277696
[red-knot] Handle context managers in (sync) with statements ( #13998 )
2024-10-31 08:18:18 +00:00
Steve C
2d917d72f6
[`pyupgrade`] - add PEP646 Unpack conversion to `*` with fix (`UP044`) ( #13988 )
...
Co-authored-by: Micha Reiser <micha@reiser.io>
2024-10-31 06:58:34 +00:00
Dhruv Manilawala
2629527559
Fix panic when filling up types vector during unpacking ( #14006 )
...
## Summary
This PR fixes a panic which can occur in an unpack assignment when:
* (number of target expressions) - (number of tuple types) > 2
* There's a starred expression
The reason being that the `insert` panics because the index is greater
than the length.
This is an error case and so practically it should occur very rarely.
The solution is to resize the types vector to match the number of
expressions and then insert the starred expression type.
## Test Plan
Add a new test case.
2024-10-30 19:13:57 +00:00
Dhruv Manilawala
bf20061268
Separate type check diagnostics builder ( #13978 )
...
## Summary
This PR creates a new `TypeCheckDiagnosticsBuilder` for the
`TypeCheckDiagnostics` struct. The main motivation behind this is to
separate the helpers required to build the diagnostics from the type
inference builder itself. This allows us to use such helpers outside of
the inference builder like for example in the unpacking logic in
https://github.com/astral-sh/ruff/pull/13979 .
## Test Plan
`cargo insta test`
2024-10-30 18:50:31 +00:00
Charlie Marsh
eddc8d7644
Add failing tests for augmented assignments with partial binding ( #14002 )
...
## Summary
These cases aren't handled correctly yet -- some of them are waiting on
refactors to `Unbound` before fixing. Part of #12699 .
---------
Co-authored-by: Carl Meyer <carl@astral.sh>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-10-30 14:22:34 -04:00
Charlie Marsh
b1ce8a3949
Use `Never` instead of `None` for stores ( #13984 )
...
## Summary
See:
https://github.com/astral-sh/ruff/pull/13981#issuecomment-2445472433
2024-10-30 12:03:50 -04:00