Skip to content

Commit d5b5f09

Browse files
committed
post-merge fixes: enum-variant flags, self expansion, mdtest expectations
- sort pep695 typevar-removal iteration and merge rename frames via extend (new iter-over-hash-type lint) - regenerate uv.lock for the merged [dependency-groups] - accept ci-gate inline snapshots (.pyi->.byi paths, ty->by binary name, fork doc urls, 0.0.3 crate versions); rustfmt pass - pack class-header bools into ClassLiteralFlags (salsa 12-field limit), add IS_ENUM_VARIANT so upstream's has_type_params fast path doesn't skip variant generic-context inheritance - expand a payload-enum-bounded Self to its variant union in expand_type so match self stays exhaustive under upstream's new coverage analysis - gate upstream's ~T negation-type syntax and BitAnd runtime probe to standard python files - port covariant-projection write check into attribute_assignment.rs - rewire based payload-enum split from deleted narrow.rs helpers into type_expansion.rs - update mdtest expectations for fork divergences (covariant Mapping key, typeshed typevar names, is_subtype_of moved to ty_extensions._internal) - dedupe [dependency-groups] in pyproject.toml - regenerate ty docs (cargo dev generate-all)
1 parent 40eb64b commit d5b5f09

60 files changed

Lines changed: 1618 additions & 867 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.

crates/by_transforms/src/transforms/anon_named_tuple.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,9 +207,7 @@ impl<'src> AnonNamedTuple<'src> {
207207
fn active_typevar_renames(&self) -> HashMap<String, String> {
208208
let mut out = HashMap::new();
209209
for frame in &self.typevar_rename_stack {
210-
for (k, v) in frame {
211-
out.insert(k.clone(), v.clone());
212-
}
210+
out.extend(frame.clone());
213211
}
214212
out
215213
}

crates/by_typeshed_patch/src/pep695.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ pub fn convert_module(parsed: &Parsed<ModModule>, source: &str) -> Vec<Edit> {
133133
// (e.g. `AnyStr`) may be re-exported and imported by other modules, so it
134134
// must survive even when unused within its own module
135135
let uses = collect_uses(&module.body, &table);
136-
for (name, decl) in &table {
136+
let mut decls: Vec<_> = table.iter().collect();
137+
decls.sort_by_key(|(name, _)| **name);
138+
for (name, decl) in decls {
137139
if !name.starts_with('_') {
138140
continue;
139141
}

crates/ruff/tests/cli/snapshots/cli__lint__output_format_json-lines.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"
@@ -16,8 +16,8 @@ info:
1616
success: false
1717
exit_code: 1
1818
----- stdout -----
19-
{"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"[TMP]/input.py","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","name":"unused-import","noqa_row":1,"severity":"error","url":"https://docs.astral.sh/ruff/rules/unused-import"}
20-
{"cell":null,"code":"F821","end_location":{"column":6,"row":2},"filename":"[TMP]/input.py","fix":null,"location":{"column":5,"row":2},"message":"Undefined name `y`","name":"undefined-name","noqa_row":2,"severity":"error","url":"https://docs.astral.sh/ruff/rules/undefined-name"}
19+
{"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"[TMP]/input.py","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","name":"unused-import","noqa_row":1,"severity":"error","url":"https://kotlinisland.github.io/basedpython/rules/unused-import"}
20+
{"cell":null,"code":"F821","end_location":{"column":6,"row":2},"filename":"[TMP]/input.py","fix":null,"location":{"column":5,"row":2},"message":"Undefined name `y`","name":"undefined-name","noqa_row":2,"severity":"error","url":"https://kotlinisland.github.io/basedpython/rules/undefined-name"}
2121
{"cell":null,"code":"invalid-syntax","end_location":{"column":6,"row":3},"filename":"[TMP]/input.py","fix":null,"location":{"column":1,"row":3},"message":"Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)","name":"invalid-syntax","noqa_row":null,"severity":"error","url":null}
2222

2323
----- stderr -----

crates/ruff/tests/cli/snapshots/cli__lint__output_format_preview_json-lines.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"
@@ -17,8 +17,8 @@ info:
1717
success: false
1818
exit_code: 1
1919
----- stdout -----
20-
{"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"[TMP]/input.py","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","name":"unused-import","noqa_row":1,"severity":"error","url":"https://docs.astral.sh/ruff/rules/unused-import"}
21-
{"cell":null,"code":"F821","end_location":{"column":6,"row":2},"filename":"[TMP]/input.py","fix":null,"location":{"column":5,"row":2},"message":"Undefined name `y`","name":"undefined-name","noqa_row":2,"severity":"error","url":"https://docs.astral.sh/ruff/rules/undefined-name"}
20+
{"cell":null,"code":"F401","end_location":{"column":10,"row":1},"filename":"[TMP]/input.py","fix":{"applicability":"safe","edits":[{"content":"","end_location":{"column":1,"row":2},"location":{"column":1,"row":1}}],"message":"Remove unused import: `os`"},"location":{"column":8,"row":1},"message":"`os` imported but unused","name":"unused-import","noqa_row":1,"severity":"error","url":"https://kotlinisland.github.io/basedpython/rules/unused-import"}
21+
{"cell":null,"code":"F821","end_location":{"column":6,"row":2},"filename":"[TMP]/input.py","fix":null,"location":{"column":5,"row":2},"message":"Undefined name `y`","name":"undefined-name","noqa_row":2,"severity":"error","url":"https://kotlinisland.github.io/basedpython/rules/undefined-name"}
2222
{"cell":null,"code":null,"end_location":{"column":6,"row":3},"filename":"[TMP]/input.py","fix":null,"location":{"column":1,"row":3},"message":"Cannot use `match` statement on Python 3.9 (syntax was added in Python 3.10)","name":"invalid-syntax","noqa_row":null,"severity":"error","url":null}
2323

2424
----- stderr -----

crates/ruff/tests/cli/snapshots/cli__lint__output_format_preview_json.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"
@@ -51,7 +51,7 @@ exit_code: 1
5151
"name": "unused-import",
5252
"noqa_row": 1,
5353
"severity": "error",
54-
"url": "https://docs.astral.sh/ruff/rules/unused-import"
54+
"url": "https://kotlinisland.github.io/basedpython/rules/unused-import"
5555
},
5656
{
5757
"cell": null,
@@ -70,7 +70,7 @@ exit_code: 1
7070
"name": "undefined-name",
7171
"noqa_row": 2,
7272
"severity": "error",
73-
"url": "https://docs.astral.sh/ruff/rules/undefined-name"
73+
"url": "https://kotlinisland.github.io/basedpython/rules/undefined-name"
7474
},
7575
{
7676
"cell": null,

crates/ruff/tests/cli/snapshots/cli__lint__output_format_preview_rdjson.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"
@@ -21,7 +21,7 @@ exit_code: 1
2121
"diagnostics": [
2222
{
2323
"code": {
24-
"url": "https://docs.astral.sh/ruff/rules/unused-import",
24+
"url": "https://kotlinisland.github.io/basedpython/rules/unused-import",
2525
"value": "unused-import"
2626
},
2727
"location": {
@@ -56,7 +56,7 @@ exit_code: 1
5656
},
5757
{
5858
"code": {
59-
"url": "https://docs.astral.sh/ruff/rules/undefined-name",
59+
"url": "https://kotlinisland.github.io/basedpython/rules/undefined-name",
6060
"value": "undefined-name"
6161
},
6262
"location": {
@@ -97,7 +97,7 @@ exit_code: 1
9797
"severity": "WARNING",
9898
"source": {
9999
"name": "ruff",
100-
"url": "https://docs.astral.sh/ruff"
100+
"url": "https://kotlinisland.github.io/basedpython"
101101
}
102102
}
103103
----- stderr -----

crates/ruff/tests/cli/snapshots/cli__lint__output_format_preview_sarif.snap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"
@@ -125,7 +125,7 @@ exit_code: 1
125125
"help": {
126126
"text": "Undefined name `{name}`. {tip}"
127127
},
128-
"helpUri": "https://docs.astral.sh/ruff/rules/undefined-name",
128+
"helpUri": "https://kotlinisland.github.io/basedpython/rules/undefined-name",
129129
"id": "undefined-name",
130130
"properties": {
131131
"id": "undefined-name",
@@ -144,7 +144,7 @@ exit_code: 1
144144
"help": {
145145
"text": "`{name}` imported but unused; consider using `importlib.util.find_spec` to test for availability"
146146
},
147-
"helpUri": "https://docs.astral.sh/ruff/rules/unused-import",
147+
"helpUri": "https://kotlinisland.github.io/basedpython/rules/unused-import",
148148
"id": "unused-import",
149149
"properties": {
150150
"id": "unused-import",

crates/ruff/tests/cli/snapshots/cli__lint__required_import_set_aliased_as_abstract_set_no_conflict.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"

crates/ruff/tests/cli/snapshots/cli__lint__required_import_set_conflicts_with_pyi025.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"

crates/ruff/tests/cli/snapshots/cli__lint__required_import_set_without_pyi025_no_conflict.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
source: crates/ruff/tests/cli/lint.rs
33
info:
4-
program: ruff
4+
program: buff
55
args:
66
- check
77
- "--no-cache"

0 commit comments

Comments
 (0)