ruff/crates/ruff
Charlie Marsh 51d69b448c
Improve compatibility between multi-statement PYI rules (#7024)
## Summary

This PR modifies a few of our rules related to which statements (and how
many) are allowed in function bodies within `.pyi` files, to improve
compatibility with flake8-pyi and improve the interplay dynamics between
them. Each change fixes a deviation from flake8-pyi:

- We now always trigger the multi-statement rule (PYI048) regardless of
whether one of the statements is a docstring.
- We no longer trigger the `...` rule (PYI010) if the single statement
is a docstring or a `pass` (since those are covered by other rules).
- We no longer trigger the `...` rule (PYI010) if the function body
contains multiple statements (since that's covered by PYI048).

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

## Test Plan

`cargo test`
2023-08-31 21:45:26 +01:00
..
resources/test Improve compatibility between multi-statement PYI rules (#7024) 2023-08-31 21:45:26 +01:00
src Improve compatibility between multi-statement PYI rules (#7024) 2023-08-31 21:45:26 +01:00
Cargo.toml Move Configuration to ruff_workspace crate (#6920) 2023-08-28 06:21:35 +00:00