mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
[TRIO] Add TRIO109 rule (#8534)
## Summary Adds TRIO109 from the [flake8-trio plugin](https://github.com/Zac-HD/flake8-trio). Relates to: https://github.com/astral-sh/ruff/issues/8451
This commit is contained in:
parent
621e98f452
commit
e2c7b1ece6
9 changed files with 98 additions and 0 deletions
|
@ -2281,6 +2281,15 @@ pub struct Parameters {
|
|||
}
|
||||
|
||||
impl Parameters {
|
||||
/// Returns the [`ParameterWithDefault`] with the given name, or `None` if no such [`ParameterWithDefault`] exists.
|
||||
pub fn find(&self, name: &str) -> Option<&ParameterWithDefault> {
|
||||
self.posonlyargs
|
||||
.iter()
|
||||
.chain(&self.args)
|
||||
.chain(&self.kwonlyargs)
|
||||
.find(|arg| arg.parameter.name.as_str() == name)
|
||||
}
|
||||
|
||||
/// Returns `true` if a parameter with the given name included in this [`Parameters`].
|
||||
pub fn includes(&self, name: &str) -> bool {
|
||||
if self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue