Skip to content

Commit b51c4f8

Browse files
authored
Rename Red Knot (astral-sh#17820)
1 parent e6a798b commit b51c4f8

File tree

1,564 files changed

+1577
-1557
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,564 files changed

+1577
-1557
lines changed

.github/CODEOWNERS

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# flake8-pyi
1515
/crates/ruff_linter/src/rules/flake8_pyi/ @AlexWaygood
1616

17-
# Script for fuzzing the parser/red-knot etc.
17+
# Script for fuzzing the parser/ty etc.
1818
/python/py-fuzzer/ @AlexWaygood
1919

20-
# red-knot
21-
/crates/red_knot* @carljm @MichaReiser @AlexWaygood @sharkdp @dcreager
20+
# ty
21+
/crates/ty* @carljm @MichaReiser @AlexWaygood @sharkdp @dcreager
2222
/crates/ruff_db/ @carljm @MichaReiser @AlexWaygood @sharkdp @dcreager
23-
/scripts/knot_benchmark/ @carljm @MichaReiser @AlexWaygood @sharkdp @dcreager
24-
/crates/red_knot_python_semantic @carljm @AlexWaygood @sharkdp @dcreager
23+
/scripts/ty_benchmark/ @carljm @MichaReiser @AlexWaygood @sharkdp @dcreager
24+
/crates/ty_python_semantic @carljm @AlexWaygood @sharkdp @dcreager

.github/workflows/ci.yaml

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ jobs:
3636
code: ${{ steps.check_code.outputs.changed }}
3737
# Flag that is raised when any code that affects the fuzzer is changed
3838
fuzz: ${{ steps.check_fuzzer.outputs.changed }}
39-
# Flag that is set to "true" when code related to red-knot changes.
40-
red_knot: ${{ steps.check_red_knot.outputs.changed }}
39+
# Flag that is set to "true" when code related to ty changes.
40+
ty: ${{ steps.check_ty.outputs.changed }}
4141

4242
# Flag that is set to "true" when code related to the playground changes.
4343
playground: ${{ steps.check_playground.outputs.changed }}
@@ -84,7 +84,7 @@ jobs:
8484
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':Cargo.toml' \
8585
':Cargo.lock' \
8686
':crates/**' \
87-
':!crates/red_knot*/**' \
87+
':!crates/ty*/**' \
8888
':!crates/ruff_python_formatter/**' \
8989
':!crates/ruff_formatter/**' \
9090
':!crates/ruff_dev/**' \
@@ -145,7 +145,7 @@ jobs:
145145
run: |
146146
if git diff --quiet "${MERGE_BASE}...HEAD" -- ':**' \
147147
':!**/*.md' \
148-
':crates/red_knot_python_semantic/resources/mdtest/**/*.md' \
148+
':crates/ty_python_semantic/resources/mdtest/**/*.md' \
149149
':!docs/**' \
150150
':!assets/**' \
151151
':.github/workflows/ci.yaml' \
@@ -168,15 +168,15 @@ jobs:
168168
echo "changed=true" >> "$GITHUB_OUTPUT"
169169
fi
170170
171-
- name: Check if the red-knot code changed
172-
id: check_red_knot
171+
- name: Check if the ty code changed
172+
id: check_ty
173173
env:
174174
MERGE_BASE: ${{ steps.merge_base.outputs.sha }}
175175
run: |
176176
if git diff --quiet "${MERGE_BASE}...HEAD" -- \
177177
':Cargo.toml' \
178178
':Cargo.lock' \
179-
':crates/red_knot*/**' \
179+
':crates/ty*/**' \
180180
':crates/ruff_db/**' \
181181
':crates/ruff_annotate_snippets/**' \
182182
':crates/ruff_python_ast/**' \
@@ -221,7 +221,7 @@ jobs:
221221
- name: "Clippy"
222222
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
223223
- name: "Clippy (wasm)"
224-
run: cargo clippy -p ruff_wasm -p red_knot_wasm --target wasm32-unknown-unknown --all-features --locked -- -D warnings
224+
run: cargo clippy -p ruff_wasm -p ty_wasm --target wasm32-unknown-unknown --all-features --locked -- -D warnings
225225

226226
cargo-test-linux:
227227
name: "cargo test (linux)"
@@ -246,14 +246,14 @@ jobs:
246246
uses: taiki-e/install-action@ab3728c7ba6948b9b429627f4d55a68842b27f18 # v2
247247
with:
248248
tool: cargo-insta
249-
- name: Red-knot mdtests (GitHub annotations)
250-
if: ${{ needs.determine_changes.outputs.red_knot == 'true' }}
249+
- name: ty mdtests (GitHub annotations)
250+
if: ${{ needs.determine_changes.outputs.ty == 'true' }}
251251
env:
252252
NO_COLOR: 1
253253
MDTEST_GITHUB_ANNOTATIONS_FORMAT: 1
254254
# Ignore errors if this step fails; we want to continue to later steps in the workflow anyway.
255255
# This step is just to get nice GitHub annotations on the PR diff in the files-changed tab.
256-
run: cargo test -p red_knot_python_semantic --test mdtest || true
256+
run: cargo test -p ty_python_semantic --test mdtest || true
257257
- name: "Run tests"
258258
shell: bash
259259
env:
@@ -268,7 +268,7 @@ jobs:
268268
# sync, not just public items. Eventually we should do this for all
269269
# crates; for now add crates here as they are warning-clean to prevent
270270
# regression.
271-
- run: cargo doc --no-deps -p red_knot_python_semantic -p red_knot -p red_knot_test -p ruff_db --document-private-items
271+
- run: cargo doc --no-deps -p ty_python_semantic -p ty -p ty_test -p ruff_db --document-private-items
272272
env:
273273
# Setting RUSTDOCFLAGS because `cargo doc --check` isn't yet implemented (https://github.com/rust-lang/cargo/issues/10025).
274274
RUSTDOCFLAGS: "-D warnings"
@@ -278,8 +278,8 @@ jobs:
278278
path: target/debug/ruff
279279
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
280280
with:
281-
name: red_knot
282-
path: target/debug/red_knot
281+
name: ty
282+
path: target/debug/ty
283283

284284
cargo-test-linux-release:
285285
name: "cargo test (linux, release)"
@@ -362,9 +362,9 @@ jobs:
362362
run: |
363363
cd crates/ruff_wasm
364364
wasm-pack test --node
365-
- name: "Test red_knot_wasm"
365+
- name: "Test ty_wasm"
366366
run: |
367-
cd crates/red_knot_wasm
367+
cd crates/ty_wasm
368368
wasm-pack test --node
369369
370370
cargo-build-release:
@@ -636,50 +636,50 @@ jobs:
636636
name: ecosystem-result
637637
path: ecosystem-result
638638

639-
fuzz-redknot:
640-
name: "Fuzz for new red-knot panics"
639+
fuzz-ty:
640+
name: "Fuzz for new ty panics"
641641
runs-on: depot-ubuntu-22.04-16
642642
needs:
643643
- cargo-test-linux
644644
- determine_changes
645645
# Only runs on pull requests, since that is the only we way we can find the base version for comparison.
646-
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.red_knot == 'true' }}
646+
if: ${{ !contains(github.event.pull_request.labels.*.name, 'no-test') && github.event_name == 'pull_request' && needs.determine_changes.outputs.ty == 'true' }}
647647
timeout-minutes: 20
648648
steps:
649649
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
650650
with:
651651
persist-credentials: false
652652
- uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
653-
name: Download new red-knot binary
654-
id: redknot-new
653+
name: Download new ty binary
654+
id: ty-new
655655
with:
656-
name: red_knot
656+
name: ty
657657
path: target/debug
658658
- uses: dawidd6/action-download-artifact@20319c5641d495c8a52e688b7dc5fada6c3a9fbc # v8
659-
name: Download baseline red-knot binary
659+
name: Download baseline ty binary
660660
with:
661-
name: red_knot
661+
name: ty
662662
branch: ${{ github.event.pull_request.base.ref }}
663663
workflow: "ci.yaml"
664664
check_artifacts: true
665665
- uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
666666
- name: Fuzz
667667
env:
668668
FORCE_COLOR: 1
669-
NEW_REDKNOT: ${{ steps.redknot-new.outputs.download-path }}
669+
NEW_TY: ${{ steps.ty-new.outputs.download-path }}
670670
run: |
671671
# Make executable, since artifact download doesn't preserve this
672-
chmod +x "${PWD}/red_knot" "${NEW_REDKNOT}/red_knot"
672+
chmod +x "${PWD}/ty" "${NEW_TY}/ty"
673673
674674
(
675675
uvx \
676676
--python="${PYTHON_VERSION}" \
677677
--from=./python/py-fuzzer \
678678
fuzz \
679-
--test-executable="${NEW_REDKNOT}/red_knot" \
680-
--baseline-executable="${PWD}/red_knot" \
679+
--test-executable="${NEW_TY}/ty" \
680+
--baseline-executable="${PWD}/ty" \
681681
--only-new-bugs \
682-
--bin=red_knot \
682+
--bin=ty \
683683
0-500
684684
)
685685

.github/workflows/daily_property_tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ jobs:
3838
- name: "Install mold"
3939
uses: rui314/setup-mold@e16410e7f8d9e167b74ad5697a9089a35126eb50 # v1
4040
- uses: Swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6 # v2.7.8
41-
- name: Build Red Knot
41+
- name: Build ty
4242
# A release build takes longer (2 min vs 1 min), but the property tests run much faster in release
4343
# mode (1.5 min vs 14 min), so the overall time is shorter with a release build.
44-
run: cargo build --locked --release --package red_knot_python_semantic --tests
44+
run: cargo build --locked --release --package ty_python_semantic --tests
4545
- name: Run property tests
4646
shell: bash
4747
run: |
4848
export QUICKCHECK_TESTS=100000
4949
for _ in {1..5}; do
50-
cargo test --locked --release --package red_knot_python_semantic -- --ignored list::property_tests
51-
cargo test --locked --release --package red_knot_python_semantic -- --ignored types::property_tests::stable
50+
cargo test --locked --release --package ty_python_semantic -- --ignored list::property_tests
51+
cargo test --locked --release --package ty_python_semantic -- --ignored types::property_tests::stable
5252
done
5353
5454
create-issue-on-failure:
@@ -68,5 +68,5 @@ jobs:
6868
repo: "ruff",
6969
title: `Daily property test run failed on ${new Date().toDateString()}`,
7070
body: "Run listed here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
71-
labels: ["bug", "red-knot", "testing"],
71+
labels: ["bug", "ty", "testing"],
7272
})

.github/workflows/mypy_primer.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ permissions: {}
55
on:
66
pull_request:
77
paths:
8-
- "crates/red_knot*/**"
8+
- "crates/ty*/**"
99
- "crates/ruff_db"
1010
- "crates/ruff_python_ast"
1111
- "crates/ruff_python_parser"
@@ -50,7 +50,7 @@ jobs:
5050
run: |
5151
cd ruff
5252
53-
PRIMER_SELECTOR="$(paste -s -d'|' crates/red_knot_python_semantic/resources/primer/good.txt)"
53+
PRIMER_SELECTOR="$(paste -s -d'|' crates/ty_python_semantic/resources/primer/good.txt)"
5454
5555
echo "new commit"
5656
git rev-list --format=%s --max-count=1 "$GITHUB_SHA"
@@ -65,10 +65,10 @@ jobs:
6565
echo "Project selector: $PRIMER_SELECTOR"
6666
# Allow the exit code to be 0 or 1, only fail for actual mypy_primer crashes/bugs
6767
uvx \
68-
--from="git+https://github.com/hauntsaninja/mypy_primer@b83b9eade0b7ed2f4b9b129b163acac1ecb48f71" \
68+
--from="git+https://github.com/hauntsaninja/mypy_primer@4b15cf3b07db69db67bbfaebfffb2a8a28040933" \
6969
mypy_primer \
7070
--repo ruff \
71-
--type-checker knot \
71+
--type-checker ty \
7272
--old base_commit \
7373
--new "$GITHUB_SHA" \
7474
--project-selector "/($PRIMER_SELECTOR)\$" \

.github/workflows/publish-knot-playground.yml renamed to .github/workflows/publish-ty-playground.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# Publish the Red Knot playground.
2-
name: "[Knot Playground] Release"
1+
# Publish the ty playground.
2+
name: "[ty Playground] Release"
33

44
permissions: {}
55

66
on:
77
push:
88
branches: [main]
99
paths:
10-
- "crates/red_knot*/**"
10+
- "crates/ty*/**"
1111
- "crates/ruff_db/**"
1212
- "crates/ruff_python_ast/**"
1313
- "crates/ruff_python_parser/**"
1414
- "playground/**"
15-
- ".github/workflows/publish-knot-playground.yml"
15+
- ".github/workflows/publish-ty-playground.yml"
1616

1717
concurrency:
1818
group: ${{ github.workflow }}-${{ github.ref_name }}
@@ -45,8 +45,8 @@ jobs:
4545
- name: "Run TypeScript checks"
4646
run: npm run check
4747
working-directory: playground
48-
- name: "Build Knot playground"
49-
run: npm run build --workspace knot-playground
48+
- name: "Build ty playground"
49+
run: npm run build --workspace ty-playground
5050
working-directory: playground
5151
- name: "Deploy to Cloudflare Pages"
5252
if: ${{ env.CF_API_TOKEN_EXISTS == 'true' }}
@@ -55,4 +55,4 @@ jobs:
5555
apiToken: ${{ secrets.CF_API_TOKEN }}
5656
accountId: ${{ secrets.CF_ACCOUNT_ID }}
5757
# `github.head_ref` is only set during pull requests and for manual runs or tags we use `main` to deploy to production
58-
command: pages deploy playground/knot/dist --project-name=knot-playground --branch ${{ github.head_ref || 'main' }} --commit-hash ${GITHUB_SHA}
58+
command: pages deploy playground/ty/dist --project-name=ty-playground --branch ${{ github.head_ref || 'main' }} --commit-hash ${GITHUB_SHA}

.github/workflows/sync_typeshed.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ jobs:
3939
- name: Sync typeshed
4040
id: sync
4141
run: |
42-
rm -rf ruff/crates/red_knot_vendored/vendor/typeshed
43-
mkdir ruff/crates/red_knot_vendored/vendor/typeshed
44-
cp typeshed/README.md ruff/crates/red_knot_vendored/vendor/typeshed
45-
cp typeshed/LICENSE ruff/crates/red_knot_vendored/vendor/typeshed
46-
cp -r typeshed/stdlib ruff/crates/red_knot_vendored/vendor/typeshed/stdlib
47-
rm -rf ruff/crates/red_knot_vendored/vendor/typeshed/stdlib/@tests
48-
git -C typeshed rev-parse HEAD > ruff/crates/red_knot_vendored/vendor/typeshed/source_commit.txt
42+
rm -rf ruff/crates/ty_vendored/vendor/typeshed
43+
mkdir ruff/crates/ty_vendored/vendor/typeshed
44+
cp typeshed/README.md ruff/crates/ty_vendored/vendor/typeshed
45+
cp typeshed/LICENSE ruff/crates/ty_vendored/vendor/typeshed
46+
cp -r typeshed/stdlib ruff/crates/ty_vendored/vendor/typeshed/stdlib
47+
rm -rf ruff/crates/ty_vendored/vendor/typeshed/stdlib/@tests
48+
git -C typeshed rev-parse HEAD > ruff/crates/ty_vendored/vendor/typeshed/source_commit.txt
4949
- name: Commit the changes
5050
id: commit
5151
if: ${{ steps.sync.outcome == 'success' }}
@@ -79,5 +79,5 @@ jobs:
7979
repo: "ruff",
8080
title: `Automated typeshed sync failed on ${new Date().toDateString()}`,
8181
body: "Run listed here: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
82-
labels: ["bug", "red-knot"],
82+
labels: ["bug", "ty"],
8383
})

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ fail_fast: false
33
exclude: |
44
(?x)^(
55
.github/workflows/release.yml|
6-
crates/red_knot_vendored/vendor/.*|
7-
crates/red_knot_project/resources/.*|
6+
crates/ty_vendored/vendor/.*|
7+
crates/ty_project/resources/.*|
88
crates/ruff_benchmark/resources/.*|
99
crates/ruff_linter/resources/.*|
1010
crates/ruff_linter/src/rules/.*/snapshots/.*|

0 commit comments

Comments
 (0)