Developer
Asuka Minato
i@asukaminato.eu.org
Performance
Key patterns and highlights from this developer's activity.
Breakdown of growth, maintenance, and fixes effort over time.
Bugs introduced vs. fixed over time.
Reclassifies engineering effort based on bug attribution. Commits that introduced bugs are retrospectively counted as poor investments.
Investment Quality reclassifies engineering effort based on bug attribution data. Commits identified as buggy origins (those that introduced bugs later fixed by someone) have their grow and maintenance time moved into the Wasted Time category. Their waste (fix commits) remains counted as productive. All other commits retain their standard classification: grow is productive, maintenance is maintenance, and waste (fixes) is productive.
The standard model classifies commits as Growth, Maintenance, or Fixes. Investment Quality adds a quality lens: a commit that introduced a bug is retrospectively counted as a poor investment — the engineering time spent on it was wasted because it ultimately required additional fix work. Fix commits (Fixes in the standard model) are reframed as productive, because fixing bugs is valuable work.
Currently computed client-side from commit and bug attribution data. Ideal server-side endpoint:
POST /v1/organizations/{orgId}/investment-quality
Content-Type: application/json
Request:
{
"startTime": "2025-01-01T00:00:00Z",
"endTime": "2025-12-31T23:59:59Z",
"bucketSize": "BUCKET_SIZE_MONTH",
"groupBy": ["repository_id" | "deliverer_email"]
}
Response:
{
"productivePct": 74,
"maintenancePct": 18,
"wastedPct": 8,
"buckets": [
{
"bucketStart": "2025-01-01T00:00:00Z",
"productive": 4.2,
"maintenance": 1.8,
"wasted": 0.6
}
]
}Latest analyzed commits from this developer.
| Hash | Message | Date | Files | Effort |
|---|---|---|---|---|
| 28fcfa72 | This commit introduces a **bug fix** to the **virtual environment finding logic** within the `pyrefly_config` crate, specifically in `crates/pyrefly_config/src/environment/venv.rs`. Previously, Pyrefly only searched downwards from the current project root for `.venv` directories, leading to failures when the virtual environment was located in an ancestor path. The change refactors the `venv` search to perform an **upward find**, scanning the `project_path` and its parent directories to locate the nearest `.venv`. This significantly **improves the reliability of environment detection** for projects with non-standard virtual environment placements, ensuring Pyrefly can correctly identify and utilize them. | Mar 31 | 1 | waste |
| ba4ae4f3 | This commit provides a **bug fix** for the **Language Server Protocol (LSP)**, specifically addressing uninformative tooltips for `typing.NamedTuple` constructors. It **resolves an issue** where the LSP trace for constructor calls was incorrectly overwritten by `__init__`, resulting in generic `*Unknown, **Unknown` tooltips. The **constructor call resolution logic** within `pyrefly/lib/alt/call.rs` has been updated to prioritize metaclass `__call__` and `__new__` over `__init__` when recording traces. This ensures that **LSP features** like hover and signature help now correctly display detailed field signatures for `NamedTuple` instances, significantly improving developer experience for Python developers using the LSP. | Mar 26 | 4 | maint |
| 9832cb7f | This commit **fixes** a bug where **inline functional namedtuple definitions** (e.g., `collections.namedtuple(...)` or `typing.NamedTuple(...)` used directly in an expression) were not correctly recognized and processed. It introduces the **new capability** to synthesize anonymous classes for these inline definitions, ensuring proper type inference and binding. The **type inference engine** (`pyrefly/lib/alt/expr.rs`) and **binding logic** (`pyrefly/lib/binding/expr.rs`) are updated to support this, alongside a fix in `pyrefly/lib/alt/class/class_field.rs` to prevent incorrect override checks for named tuple elements. This significantly enhances the **correctness and robustness of the type analysis** for Python code utilizing `namedtuple` in various contexts. | Mar 26 | 5 | grow |
| 11c07a3f | This commit **fixes** a **bug** in `pyrefly`'s **LSP hover functionality** that prevented class symbols from displaying their constructor signature and docstring. Previously, hover information for these symbols showed a generic `type[Class]` form, which was unhelpful for understanding class instantiation. The `get_hover` function in `pyrefly/lib/lsp/wasm/hover.rs` is updated to correctly render constructor details, significantly improving the **accuracy and utility of hover information** for class types. This enhancement provides a better **developer experience** by offering more comprehensive context directly within the editor. | Mar 26 | 6 | waste |
| eb60a8db | This commit delivers a **bug fix** for `pyrefly`'s **implicit-return analysis**, specifically correcting how `while...else` statements are evaluated. Previously, the analyzer incorrectly treated the `orelse` branch of a `while...else` as an unconditional fallthrough, leading to inaccurate exhaustiveness checks for function return paths. The change in `pyrefly/lib/binding/function.rs` within the `function_last_expressions` logic now correctly recognizes this branch as a normal termination path. This significantly improves the **accuracy** of `pyrefly`'s static analysis for code utilizing `while...else` constructs, with new **test cases** added to validate the corrected behavior. | Mar 25 | 2 | waste |
| 9310a6ef | This commit delivers a **bug fix** for the **type checker's `invalid-type-var` detection**, resolving false positives when persisting generic methods. The previous sanitization logic in `pyrefly/lib/alt/class/class_field.rs` did not correctly exempt type parameters from generic overload signatures and bound-method overloads, leading to erroneous reports. The `collect_forall_tparams` function has been enhanced to properly identify and exempt these type parameters, preventing incorrect `invalid-type-var` warnings. This change improves the **accuracy of the type system**, particularly when storing generic methods like `dict[str, str].get` as instance attributes. | Mar 25 | 2 | waste |
| 2f3ad552 | This commit delivers a **bug fix** for **Pyrefly's diagnostic system**, specifically addressing duplicate error reporting when `__all__` declarations contain undefined names. Previously, Pyrefly would report a `bad-dunder-all` error and then repeatedly flag the same issue at every import site. Now, the **`exports` module** in `pyrefly/lib/export/exports.rs` is enhanced to track these invalid `__all__` entries as a new type of export, and `pyrefly/lib/binding/bindings.rs` synthesizes error bindings for them. This change ensures the error is reported only once at the `__all__` declaration, significantly **reducing diagnostic noise** and improving the clarity of error messages for **static analysis and LSP features**. | Mar 24 | 6 | waste |
| 7342efad | This commit **enhances** the `pyrefly` tool by introducing a new **configuration option** to set the default output format for the `pyrefly check` command. Users can now specify `output-format` within their project's `pyrefly.toml` or `[tool.pyrefly]` section in `pyproject.toml`, which the `check` command will inherit unless explicitly overridden via the `--output-format` CLI flag. This **new capability** involves **refactoring** output format handling in `pyrefly/lib/commands/check.rs`, updating the `crates/pyrefly_config` crate to recognize the setting, and adding corresponding **documentation**. This allows for consistent project-wide output formatting while maintaining flexibility for ad-hoc checks. | Mar 24 | 3 | grow |
| 1cac6146 | This commit delivers a **bug fix** for the **type comparison logic** in the `pyrefly/lib/alt/operators.rs` module, specifically addressing an issue where the `Operator <` failed on identical constrained `TypeVar` operands. Previously, the system would incorrectly attempt to compare the unspecialized base types, leading to erroneous evaluations. The `compare_types` function now includes specific logic to correctly correlate and compare identical constrained `TypeVar`s, such as `N = TypeVar("N", int, float)`, based on their shared constraints. This ensures **accurate type inference and checking for generic code** utilizing constrained type variables, with a new test case added to confirm the correct behavior. | Mar 18 | 2 | waste |
| 7409a97d | This commit delivers a **bug fix** for the **dataclass implementation** in `pyrefly`, specifically resolving a false positive error when using `@dataclass(frozen=True)` with `ClassVar` members. Previously, `ClassVar` fields were incorrectly classified as frozen instance fields, leading to erroneous rejections of class-level assignments. The change in `pyrefly/lib/alt/class/class_field.rs` **corrects this behavior**, ensuring that `ClassVar` members can now be properly assigned via the class object (e.g., `self.__class__.x = False`) while maintaining their intended instance-level write restrictions. This improves the correctness and usability of frozen dataclasses by allowing valid class-level modifications to `ClassVar`s. | Mar 17 | 2 | waste |
| 34d0d2e1 | This commit provides a **bug fix** addressing a **type narrowing loss** issue for **captured variables** within **closures** in `pyrefly`. It **corrects the capture seeding logic** within the `pyrefly/lib/binding` module to ensure proper propagation of type narrowing from the outer scope. Specifically, the `seed_captured_variables` function now prioritizes the outer flow's current value binding when a variable is fixed before the nested function definition, while retaining the rule against propagation if reassigned after the inner definition. This enhancement to **scope management** and **binding analysis** prevents incorrect type assumptions, leading to more accurate **type inference** for users of `pyrefly` when dealing with nested functions and variable reassignment. | Mar 14 | 3 | waste |
| 19a9fb53 | This commit **fixes a bug** in the **type inference system's membership narrowing logic** where `in` and `not in` expressions involving `frozenset` instances created from literal iterables were not correctly handled. It **extends the `narrow_in` and `narrow_not_in` functions** within `pyrefly/lib/alt/narrow.rs` to properly extract elements from `frozenset(...)` calls when their arguments are literal lists, tuples, or sets. This **enhances the accuracy of static analysis** by treating these `frozenset` constructions like other literal containers, ensuring more precise type narrowing. The change improves the reliability of type checking for Python code utilizing `frozenset` literals, with new tests in `pyrefly/lib/test/narrow.rs` validating the improved behavior. | Mar 13 | 2 | maint |
| b274722c | This commit **fixes** a bug in `pyrefly`'s **static analysis engine** related to variable initialization tracking. It modifies the `lookup_name` function within `pyrefly/lib/binding/bindings.rs` to correctly update a variable's initialization status upon runtime read. Specifically, a variable is now marked as initialized in the current flow only if it was previously `Conditionally` or `DeferredCheck` initialized. This change **suppresses false-positive "may be uninitialized" errors** for variables that are indeed initialized through specific control flow paths, thereby improving the accuracy of the analysis. New test cases are added and existing `try-except-finally` tests in `pyrefly/lib/test/scope.rs` are adjusted to validate this corrected behavior. | Mar 12 | 2 | waste |
| 3a9ee280 | This commit **fixes a false positive** in the static analyzer, preventing incorrect "Missing-attribute" errors when `super()` calls are made to **abstract methods that possess a runtime implementation**. It introduces a new `lacks_runtime_implementation` check within the **`pyrefly_types`** module to accurately identify functions without concrete bodies. This check is then integrated into the **call resolution logic** (`pyrefly/lib/alt/call.rs`) and **class field access validation** (`pyrefly/lib/alt/class/class_field.rs`), allowing proper interaction with such methods. This **bug fix** ensures that the analyzer correctly permits `super()` calls and access to these abstract methods, enhancing the accuracy of **PyreFly's static analysis** for Python codebases. | Mar 11 | 5 | maint |
| c3285d0e | This commit **fixes a bug** in **Pyrefly's callable subtyping logic** that caused false-positive `bad-assignment` errors when assigning `functools.partial` results to `Callable[P, T]` with a `ParamSpec`. It **enhances the type checker** by treating `*args: Any, **kwargs: Any` as a gradual callable escape hatch for `ParamSpec` comparisons, aligning it with existing behavior for plain parameter lists. This change, primarily in `pyrefly/lib/solver/subset.rs`, **improves the accuracy and flexibility of type checking** for higher-order functions. The fix resolves issue #2737, preventing incorrect type errors and making `Pyrefly` more robust when analyzing code that uses `functools.partial` with `ParamSpec`. | Mar 11 | 7 | waste |
| b690da23 | This commit provides a **bug fix** for the **Language Server Protocol (LSP)** integration, resolving an issue where `from typing import NewType` statements were incorrectly flagged as unused imports. The core change involves modifying the **binding synthesis** logic within the **PyreFlow type checker**, specifically in the `synthesize_typing_new_type` function in `pyrefly/lib/binding/class.rs`, to correctly mark the `NewType` call expression as used. This ensures that **LSP diagnostics** accurately reflect `NewType` usage, preventing false positive warnings for developers. The `bind_expr` function in `pyrefly/lib/binding/stmt.rs` was updated to align with the modified function signature. A new **regression test** has been added to the `lsp/diagnostic` module to prevent this issue from recurring. | Mar 11 | 3 | maint |
| 029b6128 | This commit delivers a **bug fix** to `pyrefly`'s static analysis engine, specifically addressing the **incorrect construction of Python `Enum` types** that define a custom `__new__` method. Previously, the analysis would bypass the enum's metaclass `__call__` path, leading to false positives when attempting to call an enum member. The fix modifies the **enum construction logic** within `pyrefly/lib/alt/call.rs` to ensure the metaclass `__call__` is properly honored, preventing custom `__new__` methods from being misapplied at call sites. This significantly improves the **accuracy of static analysis** for projects utilizing advanced `Enum` patterns, with new tests added in `pyrefly/lib/test/enums.rs` to validate the corrected behavior. | Mar 11 | 2 | waste |
| ff72f085 | This commit **fixes a critical panic** in **Pyrefly's signature diffing logic** that occurred when processing override signatures containing non-ASCII UTF-8 characters. Specifically, the `diff_ranges` function within `pyrefly/lib/error/signature_diff.rs` was refactored to compute prefix/suffix matches by character. It now safely converts back to byte offsets only at valid character boundaries, ensuring **UTF-8 safety**. This **bug fix** prevents Pyrefly from crashing due to incorrect byte offset calculations, significantly improving the **stability** and **robustness** of the tool when handling diverse character sets in code. A new regression test `test_signature_diff_no_panic` was added to confirm the fix. | Mar 11 | 2 | waste |
| ad6cd62a | This commit **fixes a bug** in the **`pyrefly_types` crate** where unary negation and inversion operators were not correctly applied to boolean literals. Specifically, the `Lit::negate` and `Lit::invert` methods in `crates/pyrefly_types/src/literal.rs` have been updated to correctly map boolean literals to their corresponding integer literal values when these operations are performed. This **bug fix** ensures **correct and robust handling of unary operations** on boolean literals throughout the PyRefly system, preventing runtime errors or incorrect results. New test cases have been added to verify the proper behavior of these operators with boolean inputs. | Mar 11 | 2 | waste |
| d45759f3 | This commit delivers a **bug fix** to the **exception handling logic** within `pyrefly`, specifically enabling support for **star-unpacking in `except` clauses**. Previously, the system would incorrectly validate `*expr` nodes as exception classes, leading to errors when processing constructs like `except (*exceptions_tuple,)`. The `decompose_except_types` method in `pyrefly/lib/alt/solve.rs` has been updated to correctly flatten these starred entries, ensuring accurate analysis of modern Python syntax. This **enhances the robustness** of `pyrefly`'s static analysis by correctly interpreting a valid Python language feature, with a new test case `test_exception_handler_star_unpacking` verifying the fix. | Mar 10 | 2 | waste |
This commit introduces a **bug fix** to the **virtual environment finding logic** within the `pyrefly_config` crate, specifically in `crates/pyrefly_config/src/environment/venv.rs`. Previously, Pyrefly only searched downwards from the current project root for `.venv` directories, leading to failures when the virtual environment was located in an ancestor path. The change refactors the `venv` search to perform an **upward find**, scanning the `project_path` and its parent directories to locate the nearest `.venv`. This significantly **improves the reliability of environment detection** for projects with non-standard virtual environment placements, ensuring Pyrefly can correctly identify and utilize them.
This commit provides a **bug fix** for the **Language Server Protocol (LSP)**, specifically addressing uninformative tooltips for `typing.NamedTuple` constructors. It **resolves an issue** where the LSP trace for constructor calls was incorrectly overwritten by `__init__`, resulting in generic `*Unknown, **Unknown` tooltips. The **constructor call resolution logic** within `pyrefly/lib/alt/call.rs` has been updated to prioritize metaclass `__call__` and `__new__` over `__init__` when recording traces. This ensures that **LSP features** like hover and signature help now correctly display detailed field signatures for `NamedTuple` instances, significantly improving developer experience for Python developers using the LSP.
This commit **fixes** a bug where **inline functional namedtuple definitions** (e.g., `collections.namedtuple(...)` or `typing.NamedTuple(...)` used directly in an expression) were not correctly recognized and processed. It introduces the **new capability** to synthesize anonymous classes for these inline definitions, ensuring proper type inference and binding. The **type inference engine** (`pyrefly/lib/alt/expr.rs`) and **binding logic** (`pyrefly/lib/binding/expr.rs`) are updated to support this, alongside a fix in `pyrefly/lib/alt/class/class_field.rs` to prevent incorrect override checks for named tuple elements. This significantly enhances the **correctness and robustness of the type analysis** for Python code utilizing `namedtuple` in various contexts.
This commit **fixes** a **bug** in `pyrefly`'s **LSP hover functionality** that prevented class symbols from displaying their constructor signature and docstring. Previously, hover information for these symbols showed a generic `type[Class]` form, which was unhelpful for understanding class instantiation. The `get_hover` function in `pyrefly/lib/lsp/wasm/hover.rs` is updated to correctly render constructor details, significantly improving the **accuracy and utility of hover information** for class types. This enhancement provides a better **developer experience** by offering more comprehensive context directly within the editor.
This commit delivers a **bug fix** for `pyrefly`'s **implicit-return analysis**, specifically correcting how `while...else` statements are evaluated. Previously, the analyzer incorrectly treated the `orelse` branch of a `while...else` as an unconditional fallthrough, leading to inaccurate exhaustiveness checks for function return paths. The change in `pyrefly/lib/binding/function.rs` within the `function_last_expressions` logic now correctly recognizes this branch as a normal termination path. This significantly improves the **accuracy** of `pyrefly`'s static analysis for code utilizing `while...else` constructs, with new **test cases** added to validate the corrected behavior.
This commit delivers a **bug fix** for the **type checker's `invalid-type-var` detection**, resolving false positives when persisting generic methods. The previous sanitization logic in `pyrefly/lib/alt/class/class_field.rs` did not correctly exempt type parameters from generic overload signatures and bound-method overloads, leading to erroneous reports. The `collect_forall_tparams` function has been enhanced to properly identify and exempt these type parameters, preventing incorrect `invalid-type-var` warnings. This change improves the **accuracy of the type system**, particularly when storing generic methods like `dict[str, str].get` as instance attributes.
This commit delivers a **bug fix** for **Pyrefly's diagnostic system**, specifically addressing duplicate error reporting when `__all__` declarations contain undefined names. Previously, Pyrefly would report a `bad-dunder-all` error and then repeatedly flag the same issue at every import site. Now, the **`exports` module** in `pyrefly/lib/export/exports.rs` is enhanced to track these invalid `__all__` entries as a new type of export, and `pyrefly/lib/binding/bindings.rs` synthesizes error bindings for them. This change ensures the error is reported only once at the `__all__` declaration, significantly **reducing diagnostic noise** and improving the clarity of error messages for **static analysis and LSP features**.
This commit **enhances** the `pyrefly` tool by introducing a new **configuration option** to set the default output format for the `pyrefly check` command. Users can now specify `output-format` within their project's `pyrefly.toml` or `[tool.pyrefly]` section in `pyproject.toml`, which the `check` command will inherit unless explicitly overridden via the `--output-format` CLI flag. This **new capability** involves **refactoring** output format handling in `pyrefly/lib/commands/check.rs`, updating the `crates/pyrefly_config` crate to recognize the setting, and adding corresponding **documentation**. This allows for consistent project-wide output formatting while maintaining flexibility for ad-hoc checks.
This commit delivers a **bug fix** for the **type comparison logic** in the `pyrefly/lib/alt/operators.rs` module, specifically addressing an issue where the `Operator <` failed on identical constrained `TypeVar` operands. Previously, the system would incorrectly attempt to compare the unspecialized base types, leading to erroneous evaluations. The `compare_types` function now includes specific logic to correctly correlate and compare identical constrained `TypeVar`s, such as `N = TypeVar("N", int, float)`, based on their shared constraints. This ensures **accurate type inference and checking for generic code** utilizing constrained type variables, with a new test case added to confirm the correct behavior.
This commit delivers a **bug fix** for the **dataclass implementation** in `pyrefly`, specifically resolving a false positive error when using `@dataclass(frozen=True)` with `ClassVar` members. Previously, `ClassVar` fields were incorrectly classified as frozen instance fields, leading to erroneous rejections of class-level assignments. The change in `pyrefly/lib/alt/class/class_field.rs` **corrects this behavior**, ensuring that `ClassVar` members can now be properly assigned via the class object (e.g., `self.__class__.x = False`) while maintaining their intended instance-level write restrictions. This improves the correctness and usability of frozen dataclasses by allowing valid class-level modifications to `ClassVar`s.
This commit provides a **bug fix** addressing a **type narrowing loss** issue for **captured variables** within **closures** in `pyrefly`. It **corrects the capture seeding logic** within the `pyrefly/lib/binding` module to ensure proper propagation of type narrowing from the outer scope. Specifically, the `seed_captured_variables` function now prioritizes the outer flow's current value binding when a variable is fixed before the nested function definition, while retaining the rule against propagation if reassigned after the inner definition. This enhancement to **scope management** and **binding analysis** prevents incorrect type assumptions, leading to more accurate **type inference** for users of `pyrefly` when dealing with nested functions and variable reassignment.
This commit **fixes a bug** in the **type inference system's membership narrowing logic** where `in` and `not in` expressions involving `frozenset` instances created from literal iterables were not correctly handled. It **extends the `narrow_in` and `narrow_not_in` functions** within `pyrefly/lib/alt/narrow.rs` to properly extract elements from `frozenset(...)` calls when their arguments are literal lists, tuples, or sets. This **enhances the accuracy of static analysis** by treating these `frozenset` constructions like other literal containers, ensuring more precise type narrowing. The change improves the reliability of type checking for Python code utilizing `frozenset` literals, with new tests in `pyrefly/lib/test/narrow.rs` validating the improved behavior.
This commit **fixes** a bug in `pyrefly`'s **static analysis engine** related to variable initialization tracking. It modifies the `lookup_name` function within `pyrefly/lib/binding/bindings.rs` to correctly update a variable's initialization status upon runtime read. Specifically, a variable is now marked as initialized in the current flow only if it was previously `Conditionally` or `DeferredCheck` initialized. This change **suppresses false-positive "may be uninitialized" errors** for variables that are indeed initialized through specific control flow paths, thereby improving the accuracy of the analysis. New test cases are added and existing `try-except-finally` tests in `pyrefly/lib/test/scope.rs` are adjusted to validate this corrected behavior.
This commit **fixes a false positive** in the static analyzer, preventing incorrect "Missing-attribute" errors when `super()` calls are made to **abstract methods that possess a runtime implementation**. It introduces a new `lacks_runtime_implementation` check within the **`pyrefly_types`** module to accurately identify functions without concrete bodies. This check is then integrated into the **call resolution logic** (`pyrefly/lib/alt/call.rs`) and **class field access validation** (`pyrefly/lib/alt/class/class_field.rs`), allowing proper interaction with such methods. This **bug fix** ensures that the analyzer correctly permits `super()` calls and access to these abstract methods, enhancing the accuracy of **PyreFly's static analysis** for Python codebases.
This commit **fixes a bug** in **Pyrefly's callable subtyping logic** that caused false-positive `bad-assignment` errors when assigning `functools.partial` results to `Callable[P, T]` with a `ParamSpec`. It **enhances the type checker** by treating `*args: Any, **kwargs: Any` as a gradual callable escape hatch for `ParamSpec` comparisons, aligning it with existing behavior for plain parameter lists. This change, primarily in `pyrefly/lib/solver/subset.rs`, **improves the accuracy and flexibility of type checking** for higher-order functions. The fix resolves issue #2737, preventing incorrect type errors and making `Pyrefly` more robust when analyzing code that uses `functools.partial` with `ParamSpec`.
This commit provides a **bug fix** for the **Language Server Protocol (LSP)** integration, resolving an issue where `from typing import NewType` statements were incorrectly flagged as unused imports. The core change involves modifying the **binding synthesis** logic within the **PyreFlow type checker**, specifically in the `synthesize_typing_new_type` function in `pyrefly/lib/binding/class.rs`, to correctly mark the `NewType` call expression as used. This ensures that **LSP diagnostics** accurately reflect `NewType` usage, preventing false positive warnings for developers. The `bind_expr` function in `pyrefly/lib/binding/stmt.rs` was updated to align with the modified function signature. A new **regression test** has been added to the `lsp/diagnostic` module to prevent this issue from recurring.
This commit delivers a **bug fix** to `pyrefly`'s static analysis engine, specifically addressing the **incorrect construction of Python `Enum` types** that define a custom `__new__` method. Previously, the analysis would bypass the enum's metaclass `__call__` path, leading to false positives when attempting to call an enum member. The fix modifies the **enum construction logic** within `pyrefly/lib/alt/call.rs` to ensure the metaclass `__call__` is properly honored, preventing custom `__new__` methods from being misapplied at call sites. This significantly improves the **accuracy of static analysis** for projects utilizing advanced `Enum` patterns, with new tests added in `pyrefly/lib/test/enums.rs` to validate the corrected behavior.
This commit **fixes a critical panic** in **Pyrefly's signature diffing logic** that occurred when processing override signatures containing non-ASCII UTF-8 characters. Specifically, the `diff_ranges` function within `pyrefly/lib/error/signature_diff.rs` was refactored to compute prefix/suffix matches by character. It now safely converts back to byte offsets only at valid character boundaries, ensuring **UTF-8 safety**. This **bug fix** prevents Pyrefly from crashing due to incorrect byte offset calculations, significantly improving the **stability** and **robustness** of the tool when handling diverse character sets in code. A new regression test `test_signature_diff_no_panic` was added to confirm the fix.
This commit **fixes a bug** in the **`pyrefly_types` crate** where unary negation and inversion operators were not correctly applied to boolean literals. Specifically, the `Lit::negate` and `Lit::invert` methods in `crates/pyrefly_types/src/literal.rs` have been updated to correctly map boolean literals to their corresponding integer literal values when these operations are performed. This **bug fix** ensures **correct and robust handling of unary operations** on boolean literals throughout the PyRefly system, preventing runtime errors or incorrect results. New test cases have been added to verify the proper behavior of these operators with boolean inputs.
This commit delivers a **bug fix** to the **exception handling logic** within `pyrefly`, specifically enabling support for **star-unpacking in `except` clauses**. Previously, the system would incorrectly validate `*expr` nodes as exception classes, leading to errors when processing constructs like `except (*exceptions_tuple,)`. The `decompose_except_types` method in `pyrefly/lib/alt/solve.rs` has been updated to correctly flatten these starred entries, ensuring accurate analysis of modern Python syntax. This **enhances the robustness** of `pyrefly`'s static analysis by correctly interpreting a valid Python language feature, with a new test case `test_exception_handler_star_unpacking` verifying the fix.
Commit activity distribution by hour and day of week. Shows when this developer is most active.
Developers who frequently work on the same files and symbols. Higher score means stronger code collaboration.