ruff/crates/ruff_python_semantic
Charlie Marsh b23414e3cc
Resolve classes and functions relative to script name (#10965)
## Summary

If the user is analyzing a script (i.e., we have no module path), it
seems reasonable to use the script name when trying to identify paths to
objects defined _within_ the script.

Closes https://github.com/astral-sh/ruff/issues/10960.

## Test Plan

Ran:

```shell
check --isolated --select=B008 \
    --config 'lint.flake8-bugbear.extend-immutable-calls=["test.A"]' \
    test.py
```

On:

```python
class A: pass

def f(a=A()):
    pass
```
2024-04-18 01:42:50 +00:00
..
src Resolve classes and functions relative to script name (#10965) 2024-04-18 01:42:50 +00:00
Cargo.toml refactor: Use QualifiedName for Imported::call_path (#10214) 2024-03-06 09:55:59 +01:00