mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-04 15:44:54 +00:00
![]()
Some checks are pending
CI / mkdocs (push) Waiting to run
CI / Determine changes (push) Waiting to run
CI / cargo fmt (push) Waiting to run
CI / cargo clippy (push) Blocked by required conditions
CI / cargo test (linux) (push) Blocked by required conditions
CI / cargo test (linux, release) (push) Blocked by required conditions
CI / cargo test (windows) (push) Blocked by required conditions
CI / cargo test (wasm) (push) Blocked by required conditions
CI / cargo build (release) (push) Waiting to run
CI / cargo build (msrv) (push) Blocked by required conditions
CI / cargo fuzz build (push) Blocked by required conditions
CI / fuzz parser (push) Blocked by required conditions
CI / test scripts (push) Blocked by required conditions
CI / ecosystem (push) Blocked by required conditions
CI / Fuzz for new ty panics (push) Blocked by required conditions
CI / cargo shear (push) Blocked by required conditions
CI / python package (push) Waiting to run
CI / pre-commit (push) Waiting to run
CI / formatter instabilities and black similarity (push) Blocked by required conditions
CI / test ruff-lsp (push) Blocked by required conditions
CI / check playground (push) Blocked by required conditions
CI / benchmarks-instrumented (push) Blocked by required conditions
CI / benchmarks-walltime (push) Blocked by required conditions
[ty Playground] Release / publish (push) Waiting to run
## Summary Two minor cleanups: - Return `Option<ClassType>` rather than `Option<ClassLiteral>` from `TypeInferenceBuilder::class_context_of_current_method`. Now that `ClassType::is_protocol` exists as a method as well as `ClassLiteral::is_protocol`, this simplifies most of the call-sites of the `class_context_of_current_method()` method. - Make more use of the `MethodDecorator::try_from_fn_type` method in `class.rs`. Under the hood, this method uses the new methods `FunctionType::is_classmethod()` and `FunctionType::is_staticmethod()` that @sharkdp recently added, so it gets the semantics more precisely correct than the code it's replacing in `infer.rs` (by accounting for implicit staticmethods/classmethods as well as explicit ones). By using these methods we can delete some code elsewhere (the `FunctionDecorators::from_decorator_types()` constructor) ## Test Plan Existing tests |
||
---|---|---|
.. | ||
resources | ||
src | ||
tests | ||
build.rs | ||
Cargo.toml | ||
mdtest.py | ||
mdtest.py.lock |