-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/tc010-fix2
- Loading branch information
Showing
307 changed files
with
11,945 additions
and
4,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# This file cannot use the extension `.yaml`. | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: New issue | ||
description: A generic issue | ||
|
||
body: | ||
- type: markdown | ||
attributes: | ||
value: | | ||
Thank you for taking the time to report an issue! We're glad to have you involved with Ruff. | ||
If you're filing a bug report, please consider including the following information: | ||
* List of keywords you searched for before creating this issue. Write them down here so that others can find this issue more easily and help provide feedback. | ||
e.g. "RUF001", "unused variable", "Jupyter notebook" | ||
* A minimal code snippet that reproduces the bug. | ||
* The command you invoked (e.g., `ruff /path/to/file.py --fix`), ideally including the `--isolated` flag. | ||
* The current Ruff settings (any relevant sections from your `pyproject.toml`). | ||
* The current Ruff version (`ruff --version`). | ||
- type: textarea | ||
attributes: | ||
label: Description | ||
description: A description of the issue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: CI | ||
|
||
permissions: {} | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
|
@@ -59,6 +61,7 @@ jobs: | |
- Cargo.toml | ||
- Cargo.lock | ||
- crates/** | ||
- "!crates/red_knot*/**" | ||
- "!crates/ruff_python_formatter/**" | ||
- "!crates/ruff_formatter/**" | ||
- "!crates/ruff_dev/**" | ||
|
@@ -116,11 +119,11 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: | | ||
rustup component add clippy | ||
rustup target add wasm32-unknown-unknown | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Clippy" | ||
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings | ||
- name: "Clippy (wasm)" | ||
|
@@ -130,12 +133,13 @@ jobs: | |
name: "cargo test (linux)" | ||
runs-on: depot-ubuntu-22.04-16 | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install mold" | ||
|
@@ -148,7 +152,6 @@ jobs: | |
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-insta | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
env: | ||
|
@@ -176,12 +179,13 @@ jobs: | |
name: "cargo test (linux, release)" | ||
runs-on: depot-ubuntu-22.04-16 | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install mold" | ||
|
@@ -194,7 +198,6 @@ jobs: | |
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-insta | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
env: | ||
|
@@ -203,24 +206,25 @@ jobs: | |
|
||
cargo-test-windows: | ||
name: "cargo test (windows)" | ||
runs-on: windows-latest-xlarge | ||
runs-on: github-windows-2025-x86_64-16 | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install cargo nextest" | ||
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-nextest | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
env: | ||
NEXTEST_PROFILE: "ci" | ||
# Workaround for <https://github.com/nextest-rs/nextest/issues/1493>. | ||
RUSTUP_WINDOWS_PATH_ADD_BIN: 1 | ||
run: | | ||
|
@@ -231,12 +235,13 @@ jobs: | |
name: "cargo test (wasm)" | ||
runs-on: ubuntu-latest | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup target add wasm32-unknown-unknown | ||
- uses: actions/setup-node@v4 | ||
|
@@ -247,7 +252,6 @@ jobs: | |
- uses: jetli/[email protected] | ||
with: | ||
version: v0.13.1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Test ruff_wasm" | ||
run: | | ||
cd crates/ruff_wasm | ||
|
@@ -266,19 +270,19 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install mold" | ||
uses: rui314/setup-mold@v1 | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Build" | ||
run: cargo build --release --locked | ||
|
||
cargo-build-msrv: | ||
name: "cargo build (msrv)" | ||
runs-on: ubuntu-latest | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -289,6 +293,7 @@ jobs: | |
with: | ||
file: "Cargo.toml" | ||
field: "workspace.package.rust-version" | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
env: | ||
MSRV: ${{ steps.msrv.outputs.value }} | ||
|
@@ -303,7 +308,6 @@ jobs: | |
uses: taiki-e/install-action@v2 | ||
with: | ||
tool: cargo-insta | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Run tests" | ||
shell: bash | ||
env: | ||
|
@@ -321,11 +325,11 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- uses: Swatinem/rust-cache@v2 | ||
with: | ||
workspaces: "fuzz -> target" | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Install cargo-binstall" | ||
uses: cargo-bins/cargo-binstall@main | ||
with: | ||
|
@@ -341,7 +345,7 @@ jobs: | |
needs: | ||
- cargo-test-linux | ||
- determine_changes | ||
if: ${{ needs.determine_changes.outputs.parser == 'true' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && needs.determine_changes.outputs.parser == 'true' }} | ||
timeout-minutes: 20 | ||
env: | ||
FORCE_COLOR: 1 | ||
|
@@ -377,15 +381,15 @@ jobs: | |
name: "test scripts" | ||
runs-on: ubuntu-latest | ||
needs: determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 5 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup component add rustfmt | ||
- uses: Swatinem/rust-cache@v2 | ||
# Run all code generation scripts, and verify that the current output is | ||
# already checked into git. | ||
- run: python crates/ruff_python_ast/generate.py | ||
|
@@ -409,7 +413,7 @@ jobs: | |
- determine_changes | ||
# Only runs on pull requests, since that is the only we way we can find the base version for comparison. | ||
# Ecosystem check needs linter and/or formatter changes. | ||
if: ${{ github.event_name == 'pull_request' && needs.determine_changes.outputs.code == 'true' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.code == 'true' }} | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
@@ -426,7 +430,7 @@ jobs: | |
name: ruff | ||
path: target/debug | ||
|
||
- uses: dawidd6/action-download-artifact@v7 | ||
- uses: dawidd6/action-download-artifact@v8 | ||
name: Download baseline Ruff binary | ||
with: | ||
name: ruff | ||
|
@@ -543,6 +547,7 @@ jobs: | |
name: "python package" | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
|
@@ -577,9 +582,9 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install pre-commit" | ||
run: pip install pre-commit | ||
- name: "Cache pre-commit" | ||
|
@@ -611,6 +616,7 @@ jobs: | |
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Add SSH key" | ||
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS == 'true' }} | ||
uses: webfactory/[email protected] | ||
|
@@ -620,7 +626,6 @@ jobs: | |
run: rustup show | ||
- name: Install uv | ||
uses: astral-sh/setup-uv@v5 | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Insiders dependencies" | ||
if: ${{ env.MKDOCS_INSIDERS_SSH_KEY_EXISTS == 'true' }} | ||
run: uv pip install -r docs/requirements-insiders.txt --system | ||
|
@@ -644,16 +649,15 @@ jobs: | |
name: "formatter instabilities and black similarity" | ||
runs-on: ubuntu-latest | ||
needs: determine_changes | ||
if: needs.determine_changes.outputs.formatter == 'true' || github.ref == 'refs/heads/main' | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.formatter == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 10 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: Swatinem/rust-cache@v2 | ||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
- name: "Cache rust" | ||
uses: Swatinem/rust-cache@v2 | ||
- name: "Run checks" | ||
run: scripts/formatter_ecosystem_checks.sh | ||
- name: "Github step summary" | ||
|
@@ -668,7 +672,7 @@ jobs: | |
needs: | ||
- cargo-test-linux | ||
- determine_changes | ||
if: ${{ needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main' }} | ||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
steps: | ||
- uses: extractions/setup-just@v2 | ||
env: | ||
|
@@ -710,14 +714,16 @@ jobs: | |
benchmarks: | ||
runs-on: ubuntu-22.04 | ||
needs: determine_changes | ||
if: ${{ github.repository == 'astral-sh/ruff' && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
if: ${{ github.repository == 'astral-sh/ruff' && !contains(github.event.pull_request.labels.*.name, 'no-test') && (needs.determine_changes.outputs.code == 'true' || github.ref == 'refs/heads/main') }} | ||
timeout-minutes: 20 | ||
steps: | ||
- name: "Checkout Branch" | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: "Install Rust toolchain" | ||
run: rustup show | ||
|
||
|
@@ -726,8 +732,6 @@ jobs: | |
with: | ||
tool: cargo-codspeed | ||
|
||
- uses: Swatinem/rust-cache@v2 | ||
|
||
- name: "Build benchmarks" | ||
run: cargo codspeed build --features codspeed -p ruff_benchmark | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.