Skip to content

Commit b1b241d

Browse files
Merge branch 'main' into 317
2 parents 2cec39a + d6f28be commit b1b241d

Some content is hidden

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

57 files changed

+1376
-593
lines changed

Cargo.lock

Lines changed: 79 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pyrefly_build/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_build"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"

crates/pyrefly_bundled/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_bundled"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"

crates/pyrefly_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_config"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"

crates/pyrefly_config/src/migration/pyright.rs

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -175,27 +175,23 @@ impl RuleOverrides {
175175
/// Consume the RuleOverrides to turn it into an ErrorDisplayConfig map.
176176
pub fn to_config(self) -> Option<ErrorDisplayConfig> {
177177
let mut map = HashMap::new();
178+
let mut add = |value, kind| {
179+
if let Some(value) = value {
180+
map.insert(
181+
kind,
182+
if value {
183+
Severity::Error
184+
} else {
185+
Severity::Ignore
186+
},
187+
);
188+
}
189+
};
178190
// For each ErrorKind, there are one or more RuleOverrides fields.
179191
// The ErrorDisplayConfig map has an entry for an ErrorKind if at least one of the RuleOverrides for that ErrorKind is present.
180192
// The value of that ErrorKind's entry is found by or'ing together the present RuleOverrides.
181-
if let Some(import_error) = [
182-
self.report_missing_imports,
183-
self.report_missing_module_source,
184-
]
185-
.into_iter()
186-
.flatten()
187-
.reduce(|acc, x| acc | x)
188-
{
189-
map.insert(
190-
ErrorKind::MissingImport,
191-
if import_error {
192-
Severity::Error
193-
} else {
194-
Severity::Ignore
195-
},
196-
);
197-
}
198-
193+
add(self.report_missing_imports, ErrorKind::MissingImport);
194+
add(self.report_missing_module_source, ErrorKind::MissingSource);
199195
if map.is_empty() {
200196
None
201197
} else {

crates/pyrefly_derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_derive"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"

crates/pyrefly_python/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_python"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"
@@ -13,7 +13,7 @@ anyhow = "1.0.98"
1313
dupe = "0.9.1"
1414
equivalent = "1.0"
1515
itertools = "0.14.0"
16-
lsp-types = "0.94.1"
16+
lsp-types = { git = "https://github.com/astral-sh/lsp-types", rev = "3512a9f33eadc5402cfab1b8f7340824c8ca1439" }
1717
parse-display = "0.8.2"
1818
pathdiff = "0.2"
1919
pyrefly_util = { path = "../pyrefly_util" }

crates/pyrefly_python/src/dunder.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ pub const MAGIC_METHOD_NAMES: &[&str] = &[
125125

126126
pub const AENTER: Name = Name::new_static("__aenter__");
127127
pub const AEXIT: Name = Name::new_static("__aexit__");
128+
pub const AITER: Name = Name::new_static("__aiter__");
129+
pub const ANEXT: Name = Name::new_static("__anext__");
128130
pub const ALL: Name = Name::new_static("__all__");
129131
pub const BOOL: Name = Name::new_static("__bool__");
130132
pub const CALL: Name = Name::new_static("__call__");

crates/pyrefly_types/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_types"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"

crates/pyrefly_util/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[package]
44
name = "pyrefly_util"
5-
version = "0.41.3"
5+
version = "0.42.1"
66
authors = ["Meta"]
77
edition = "2024"
88
repository = "https://github.com/facebook/pyrefly"
@@ -23,7 +23,7 @@ human_bytes = "0.4.3"
2323
ignore = "0.4"
2424
itertools = "0.14.0"
2525
lock_free_hashtable = "0.1.1"
26-
lsp-types = "0.94.1"
26+
lsp-types = { git = "https://github.com/astral-sh/lsp-types", rev = "3512a9f33eadc5402cfab1b8f7340824c8ca1439" }
2727
memory-stats = "1.2.0"
2828
notify = "5"
2929
parse-display = "0.8.2"

0 commit comments

Comments
 (0)