Skip to content

Commit 946e791

Browse files
authored
Merge branch 'main' into remove-tab-size-setting
2 parents 6bf7ad4 + fc661e1 commit 946e791

File tree

1,310 files changed

+44692
-10229
lines changed

Some content is hidden

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

1,310 files changed

+44692
-10229
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"extensions": [
2121
"ms-python.python",
2222
"rust-lang.rust-analyzer",
23-
"serayuzgur.crates",
23+
"fill-labs.dependi",
2424
"tamasfe.even-better-toml",
2525
"Swellaby.vscode-rust-test-adapter",
2626
"charliermarsh.ruff"

.github/renovate.json5

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,26 @@
1414
rangeStrategy: "update-lockfile",
1515
},
1616
pep621: {
17+
// The default for this package manager is to only search for `pyproject.toml` files
18+
// found at the repository root: https://docs.renovatebot.com/modules/manager/pep621/#file-matching
1719
fileMatch: ["^(python|scripts)/.*pyproject\\.toml$"],
1820
},
1921
pip_requirements: {
20-
fileMatch: ["^docs/requirements.*\\.txt$"],
22+
// The default for this package manager is to run on all requirements.txt files:
23+
// https://docs.renovatebot.com/modules/manager/pip_requirements/#file-matching
24+
// `fileMatch` doesn't work for excluding files; to exclude `requirements.txt` files
25+
// outside the `doc/` directory, we instead have to use `ignorePaths`. Unlike `fileMatch`,
26+
// which takes a regex string, `ignorePaths` takes a glob string, so we have to use
27+
// a "negative glob pattern".
28+
// See:
29+
// - https://docs.renovatebot.com/modules/manager/#ignoring-files-that-match-the-default-filematch
30+
// - https://docs.renovatebot.com/configuration-options/#ignorepaths
31+
// - https://docs.renovatebot.com/string-pattern-matching/#negative-matching
32+
ignorePaths: ["!docs/requirements*.txt"]
2133
},
2234
npm: {
35+
// The default for this package manager is to only search for `package.json` files
36+
// found at the repository root: https://docs.renovatebot.com/modules/manager/npm/#file-matching
2337
fileMatch: ["^playground/.*package\\.json$"],
2438
},
2539
"pre-commit": {

.github/workflows/ci.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939

40-
- uses: tj-actions/changed-files@v44
40+
- uses: tj-actions/changed-files@v45
4141
id: changed
4242
with:
4343
files_yaml: |
@@ -142,6 +142,13 @@ jobs:
142142

143143
# Check for broken links in the documentation.
144144
- run: cargo doc --all --no-deps
145+
env:
146+
RUSTDOCFLAGS: "-D warnings"
147+
# Use --document-private-items so that all our doc comments are kept in
148+
# sync, not just public items. Eventually we should do this for all
149+
# crates; for now add crates here as they are warning-clean to prevent
150+
# regression.
151+
- run: cargo doc --no-deps -p red_knot_python_semantic -p red_knot -p ruff_db --document-private-items
145152
env:
146153
# Setting RUSTDOCFLAGS because `cargo doc --check` isn't yet implemented (https://github.com/rust-lang/cargo/issues/10025).
147154
RUSTDOCFLAGS: "-D warnings"

.github/workflows/publish-docs.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ jobs:
3434
- name: "Set docs version"
3535
run: |
3636
version="${{ (inputs.plan != '' && fromJson(inputs.plan).announcement_tag) || inputs.ref }}"
37-
# if version is missing, exit with error
38-
if [[ -z "$version" ]]; then
39-
echo "Can't build docs without a version."
40-
exit 1
37+
# if version is missing, use 'latest'
38+
if [ -z "$version" ]; then
39+
echo "Using 'latest' as version"
40+
version="latest"
4141
fi
4242
4343
# Use version as display name for now
@@ -145,6 +145,7 @@ jobs:
145145
GITHUB_TOKEN: ${{ secrets.ASTRAL_DOCS_PAT }}
146146
run: |
147147
branch_name="${{ env.branch_name }}"
148+
148149
# auto-merge the PR if the build was triggered by a release. Manual builds should be reviewed by a human.
149150
# give the PR a few seconds to be created before trying to auto-merge it
150151
sleep 10

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# This file was autogenerated by cargo-dist: https://opensource.axo.dev/cargo-dist/
2+
#
13
# Copyright 2022-2024, axodotdev
24
# SPDX-License-Identifier: MIT or Apache-2.0
35
#
@@ -64,7 +66,7 @@ jobs:
6466
# we specify bash to get pipefail; it guards against the `curl` command
6567
# failing. otherwise `sh` won't catch that `curl` returned non-0
6668
shell: bash
67-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.18.0/cargo-dist-installer.sh | sh"
69+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.22.1/cargo-dist-installer.sh | sh"
6870
- name: Cache cargo-dist
6971
uses: actions/upload-artifact@v4
7072
with:

.github/workflows/sync_typeshed.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,13 @@ jobs:
3737
- name: Sync typeshed
3838
id: sync
3939
run: |
40-
rm -rf ruff/crates/red_knot_python_semantic/vendor/typeshed
41-
mkdir ruff/crates/red_knot_python_semantic/vendor/typeshed
42-
cp typeshed/README.md ruff/crates/red_knot_python_semantic/vendor/typeshed
43-
cp typeshed/LICENSE ruff/crates/red_knot_python_semantic/vendor/typeshed
44-
cp -r typeshed/stdlib ruff/crates/red_knot_python_semantic/vendor/typeshed/stdlib
45-
rm -rf ruff/crates/red_knot_python_semantic/vendor/typeshed/stdlib/@tests
46-
git -C typeshed rev-parse HEAD > ruff/crates/red_knot_python_semantic/vendor/typeshed/source_commit.txt
40+
rm -rf ruff/crates/red_knot_vendored/vendor/typeshed
41+
mkdir ruff/crates/red_knot_vendored/vendor/typeshed
42+
cp typeshed/README.md ruff/crates/red_knot_vendored/vendor/typeshed
43+
cp typeshed/LICENSE ruff/crates/red_knot_vendored/vendor/typeshed
44+
cp -r typeshed/stdlib ruff/crates/red_knot_vendored/vendor/typeshed/stdlib
45+
rm -rf ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/@tests
46+
git -C typeshed rev-parse HEAD > ruff/crates/red_knot_vendored/vendor/typeshed/source_commit.txt
4747
- name: Commit the changes
4848
id: commit
4949
if: ${{ steps.sync.outcome == 'success' }}

.pre-commit-config.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ fail_fast: true
22

33
exclude: |
44
(?x)^(
5-
crates/red_knot_python_semantic/vendor/.*|
5+
crates/red_knot_vendored/vendor/.*|
66
crates/red_knot_workspace/resources/.*|
77
crates/ruff_linter/resources/.*|
88
crates/ruff_linter/src/rules/.*/snapshots/.*|
9+
crates/ruff_notebook/resources/.*|
10+
crates/ruff_server/resources/.*|
911
crates/ruff/resources/.*|
1012
crates/ruff_python_formatter/resources/.*|
1113
crates/ruff_python_formatter/tests/snapshots/.*|
@@ -15,7 +17,7 @@ exclude: |
1517
1618
repos:
1719
- repo: https://github.com/abravalheri/validate-pyproject
18-
rev: v0.18
20+
rev: v0.20.2
1921
hooks:
2022
- id: validate-pyproject
2123

@@ -33,7 +35,7 @@ repos:
3335
)$
3436
3537
- repo: https://github.com/igorshubovych/markdownlint-cli
36-
rev: v0.41.0
38+
rev: v0.42.0
3739
hooks:
3840
- id: markdownlint-fix
3941
exclude: |
@@ -43,7 +45,7 @@ repos:
4345
)$
4446
4547
- repo: https://github.com/crate-ci/typos
46-
rev: v1.23.6
48+
rev: v1.25.0
4749
hooks:
4850
- id: typos
4951

@@ -57,7 +59,7 @@ repos:
5759
pass_filenames: false # This makes it a lot faster
5860

5961
- repo: https://github.com/astral-sh/ruff-pre-commit
60-
rev: v0.5.7
62+
rev: v0.6.9
6163
hooks:
6264
- id: ruff-format
6365
- id: ruff
@@ -66,8 +68,8 @@ repos:
6668
require_serial: true
6769

6870
# Prettier
69-
- repo: https://github.com/pre-commit/mirrors-prettier
70-
rev: v3.1.0
71+
- repo: https://github.com/rbubley/mirrors-prettier
72+
rev: v3.3.3
7173
hooks:
7274
- id: prettier
7375
types: [yaml]

BREAKING_CHANGES.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,43 @@
11
# Breaking Changes
22

3+
## 0.6.0
4+
5+
- Detect imports in `src` layouts by default for `isort` rules ([#12848](https://github.com/astral-sh/ruff/pull/12848))
6+
7+
- The pytest rules `PT001` and `PT023` now default to omitting the decorator parentheses when there are no arguments ([#12838](https://github.com/astral-sh/ruff/pull/12838)).
8+
9+
- Lint and format Jupyter Notebook by default ([#12878](https://github.com/astral-sh/ruff/pull/12878)).
10+
11+
You can disable specific rules for notebooks using [`per-file-ignores`](https://docs.astral.sh/ruff/settings/#lint_per-file-ignores):
12+
13+
```toml
14+
[tool.ruff.lint.per-file-ignores]
15+
"*.ipynb" = ["E501"] # disable line-too-long in notebooks
16+
```
17+
18+
If you'd prefer to either only lint or only format Jupyter Notebook files, you can use the
19+
section-specific `exclude` option to do so. For example, the following would only lint Jupyter
20+
Notebook files and not format them:
21+
22+
```toml
23+
[tool.ruff.format]
24+
exclude = ["*.ipynb"]
25+
```
26+
27+
And, conversely, the following would only format Jupyter Notebook files and not lint them:
28+
29+
```toml
30+
[tool.ruff.lint]
31+
exclude = ["*.ipynb"]
32+
```
33+
34+
You can completely disable Jupyter Notebook support by updating the [`extend-exclude`](https://docs.astral.sh/ruff/settings/#extend-exclude) setting:
35+
36+
```toml
37+
[tool.ruff]
38+
extend-exclude = ["*.ipynb"]
39+
```
40+
341
## 0.5.0
442

543
- Follow the XDG specification to discover user-level configurations on macOS (same as on other Unix platforms)

0 commit comments

Comments
 (0)