mirror of
https://github.com/astral-sh/ruff.git
synced 2025-10-03 15:15:33 +00:00
![]() ## Summary Closes https://github.com/astral-sh/ty/issues/502. In the following example: ```py class Foo: x: int def method(self): y = x ``` The user may intended to use `y = self.x` in `method`. This is now added as a subdiagnostic in the following form : `info: An attribute with the same name as 'x' is defined, consider using 'self.x'` ## Test Plan Added mdtest with snapshot diagnostics. |
||
---|---|---|
.. | ||
mdtest | ||
primer | ||
README.md |
Markdown files within the mdtest/
subdirectory are tests of type inference and type checking;
executed by the tests/mdtest.rs
integration test.
See crates/ty_test/README.md
for documentation of this test format.