ruff/crates/ruff_diagnostics/src
Charlie Marsh 7fb5f47efe
Respect # noqa directives on __all__ openers (#10798)
## Summary

Historically, given:

```python
__all__ = [  # noqa: F822
    "Bernoulli",
    "Beta",
    "Binomial",
]
```

The F822 violations would be attached to the `__all__`, so this `# noqa`
would be enforced for _all_ definitions in the list. This changed in
https://github.com/astral-sh/ruff/pull/10525 for the better, in that we
now use the range of each string. But these `# noqa` directives stopped
working.

This PR sets the `__all__` as a parent range in the diagnostic, so that
these directives are respected once again.

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

## Test Plan

`cargo test`
2024-04-06 14:51:17 +00:00
..
diagnostic.rs Respect # noqa directives on __all__ openers (#10798) 2024-04-06 14:51:17 +00:00
edit.rs Enable annotation quoting for multi-line expressions (#9142) 2023-12-15 01:03:09 +00:00
fix.rs Update applicability messages for clarity in tests (#8541) 2023-11-07 16:11:43 +00:00
lib.rs Rename FixKind to FixAvailability (#7658) 2023-10-02 14:38:25 +00:00
source_map.rs Enable formatting for Jupyter notebooks (#7749) 2023-10-02 14:44:18 +00:00
violation.rs Delete unused Violation::explanation method (#10600) 2024-03-26 12:35:27 +01:00