Skip to content

Commit 8574036

Browse files
committed
Merge branch 'main' into pgh004-file-level
2 parents d5a668c + 2f8ac1e commit 8574036

542 files changed

Lines changed: 16496 additions & 9701 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cargo/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
[alias]
22
dev = "run --package ruff_dev --bin ruff_dev"
33
benchmark = "bench -p ruff_benchmark --bench linter --bench formatter --"
4+
5+
# statically link the C runtime so the executable does not depend on
6+
# that shared/dynamic library.
7+
#
8+
# See: https://github.com/astral-sh/ruff/issues/11503
9+
[target.'cfg(all(target_env="msvc", target_os = "windows"))']
10+
rustflags = ["-C", "target-feature=+crt-static"]

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@
1515

1616
# Script for fuzzing the parser
1717
/scripts/fuzz-parser/ @AlexWaygood
18+
19+
# red-knot
20+
/crates/red_knot/ @carljm @MichaReiser

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: mkdocs build --strict -f mkdocs.public.yml
4848
- name: "Deploy to Cloudflare Pages"
4949
if: ${{ env.CF_API_TOKEN_EXISTS == 'true' }}
50-
uses: cloudflare/wrangler-action@v3.5.0
50+
uses: cloudflare/wrangler-action@v3.6.1
5151
with:
5252
apiToken: ${{ secrets.CF_API_TOKEN }}
5353
accountId: ${{ secrets.CF_ACCOUNT_ID }}

.github/workflows/playground.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
working-directory: playground
4141
- name: "Deploy to Cloudflare Pages"
4242
if: ${{ env.CF_API_TOKEN_EXISTS == 'true' }}
43-
uses: cloudflare/wrangler-action@v3.5.0
43+
uses: cloudflare/wrangler-action@v3.6.1
4444
with:
4545
apiToken: ${{ secrets.CF_API_TOKEN }}
4646
accountId: ${{ secrets.CF_ACCOUNT_ID }}

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ exclude: |
1414
1515
repos:
1616
- repo: https://github.com/abravalheri/validate-pyproject
17-
rev: v0.17
17+
rev: v0.18
1818
hooks:
1919
- id: validate-pyproject
2020

@@ -32,7 +32,7 @@ repos:
3232
)$
3333
3434
- repo: https://github.com/igorshubovych/markdownlint-cli
35-
rev: v0.40.0
35+
rev: v0.41.0
3636
hooks:
3737
- id: markdownlint-fix
3838
exclude: |
@@ -56,7 +56,7 @@ repos:
5656
pass_filenames: false # This makes it a lot faster
5757

5858
- repo: https://github.com/astral-sh/ruff-pre-commit
59-
rev: v0.4.4
59+
rev: v0.4.7
6060
hooks:
6161
- id: ruff-format
6262
- id: ruff

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"rust-lang.rust-analyzer"
4+
]
5+
}

.vscode/settings.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"rust-analyzer.check.extraArgs": [
3+
"--all-features"
4+
],
5+
"rust-analyzer.check.command": "clippy",
6+
}

CHANGELOG.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,70 @@
11
# Changelog
22

3+
## 0.4.7
4+
5+
### Preview features
6+
7+
- \[`flake8-pyi`\] Implement `PYI064` ([#11325](https://github.com/astral-sh/ruff/pull/11325))
8+
- \[`flake8-pyi`\] Implement `PYI066` ([#11541](https://github.com/astral-sh/ruff/pull/11541))
9+
- \[`flake8-pyi`\] Implement `PYI057` ([#11486](https://github.com/astral-sh/ruff/pull/11486))
10+
- \[`pyflakes`\] Enable `F822` in `__init__.py` files by default ([#11370](https://github.com/astral-sh/ruff/pull/11370))
11+
12+
### Formatter
13+
14+
- Fix incorrect placement of trailing stub function comments ([#11632](https://github.com/astral-sh/ruff/pull/11632))
15+
16+
### Server
17+
18+
- Respect file exclusions in `ruff server` ([#11590](https://github.com/astral-sh/ruff/pull/11590))
19+
- Add support for documents not exist on disk ([#11588](https://github.com/astral-sh/ruff/pull/11588))
20+
- Add Vim and Kate setup guide for `ruff server` ([#11615](https://github.com/astral-sh/ruff/pull/11615))
21+
22+
### Bug fixes
23+
24+
- Avoid removing newlines between docstring headers and rST blocks ([#11609](https://github.com/astral-sh/ruff/pull/11609))
25+
- Infer indentation with imports when logical indent is absent ([#11608](https://github.com/astral-sh/ruff/pull/11608))
26+
- Use char index rather than position for indent slice ([#11645](https://github.com/astral-sh/ruff/pull/11645))
27+
- \[`flake8-comprehension`\] Strip parentheses around generators in `C400` ([#11607](https://github.com/astral-sh/ruff/pull/11607))
28+
- Mark `repeated-isinstance-calls` as unsafe on Python 3.10 and later ([#11622](https://github.com/astral-sh/ruff/pull/11622))
29+
30+
## 0.4.6
31+
32+
### Breaking changes
33+
34+
- Use project-relative paths when calculating GitLab fingerprints ([#11532](https://github.com/astral-sh/ruff/pull/11532))
35+
- Bump minimum supported Windows version to Windows 10 ([#11613](https://github.com/astral-sh/ruff/pull/11613))
36+
37+
### Preview features
38+
39+
- \[`flake8-async`\] Sleep with >24 hour interval should usually sleep forever (`ASYNC116`) ([#11498](https://github.com/astral-sh/ruff/pull/11498))
40+
41+
### Rule changes
42+
43+
- \[`numpy`\] Add missing functions to NumPy 2.0 migration rule ([#11528](https://github.com/astral-sh/ruff/pull/11528))
44+
- \[`mccabe`\] Consider irrefutable pattern similar to `if .. else` for `C901` ([#11565](https://github.com/astral-sh/ruff/pull/11565))
45+
- Consider `match`-`case` statements for `C901`, `PLR0912`, and `PLR0915` ([#11521](https://github.com/astral-sh/ruff/pull/11521))
46+
- Remove empty strings when converting to f-string (`UP032`) ([#11524](https://github.com/astral-sh/ruff/pull/11524))
47+
- \[`flake8-bandit`\] `request-without-timeout` should warn for `requests.request` ([#11548](https://github.com/astral-sh/ruff/pull/11548))
48+
- \[`flake8-self`\] Ignore sunder accesses in `flake8-self` rules ([#11546](https://github.com/astral-sh/ruff/pull/11546))
49+
- \[`pyupgrade`\] Lint for `TypeAliasType` usages (`UP040`) ([#11530](https://github.com/astral-sh/ruff/pull/11530))
50+
51+
### Server
52+
53+
- Respect excludes in `ruff server` configuration discovery ([#11551](https://github.com/astral-sh/ruff/pull/11551))
54+
- Use default settings if initialization options is empty or not provided ([#11566](https://github.com/astral-sh/ruff/pull/11566))
55+
- `ruff server` correctly treats `.pyi` files as stub files ([#11535](https://github.com/astral-sh/ruff/pull/11535))
56+
- `ruff server` searches for configuration in parent directories ([#11537](https://github.com/astral-sh/ruff/pull/11537))
57+
- `ruff server`: An empty code action filter no longer returns notebook source actions ([#11526](https://github.com/astral-sh/ruff/pull/11526))
58+
59+
### Bug fixes
60+
61+
- \[`flake8-logging-format`\] Fix autofix title in `logging-warn` (`G010`) ([#11514](https://github.com/astral-sh/ruff/pull/11514))
62+
- \[`refurb`\] Avoid recommending `operator.itemgetter` with dependence on lambda arguments ([#11574](https://github.com/astral-sh/ruff/pull/11574))
63+
- \[`flake8-simplify`\] Avoid recommending context manager in `__enter__` implementations ([#11575](https://github.com/astral-sh/ruff/pull/11575))
64+
- Create intermediary directories for `--output-file` ([#11550](https://github.com/astral-sh/ruff/pull/11550))
65+
- Propagate reads on global variables ([#11584](https://github.com/astral-sh/ruff/pull/11584))
66+
- Treat all `singledispatch` arguments as runtime-required ([#11523](https://github.com/astral-sh/ruff/pull/11523))
67+
368
## 0.4.5
469

570
### Ruff's language server is now in Beta
@@ -134,6 +199,10 @@ To read more about this exciting milestone, check out our [blog post](https://as
134199
- Avoid allocations for isort module names ([#11251](https://github.com/astral-sh/ruff/pull/11251))
135200
- Build a separate ARM wheel for macOS ([#11149](https://github.com/astral-sh/ruff/pull/11149))
136201

202+
### Windows
203+
204+
- Increase the minimum requirement to Windows 10.
205+
137206
## 0.4.2
138207

139208
### Rule changes

CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ pre-commit run --all-files --show-diff-on-failure # Rust and Python formatting,
101101
These checks will run on GitHub Actions when you open your pull request, but running them locally
102102
will save you time and expedite the merge process.
103103

104+
If you're using VS Code, you can also install the recommended [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension to get these checks while editing.
105+
104106
Note that many code changes also require updating the snapshot tests, which is done interactively
105107
after running `cargo test` like so:
106108

0 commit comments

Comments
 (0)