Make setting and retrieving pydocstyle settings less tedious (#12582)

This commit is contained in:
Alex Waygood 2024-07-31 10:39:33 +01:00 committed by GitHub
parent 138e70bd5c
commit 83b1c48a93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 146 additions and 134 deletions

View file

@ -151,11 +151,11 @@ impl<'a> Definition<'a> {
)
}
pub fn is_property(
&self,
extra_properties: &[QualifiedName],
semantic: &SemanticModel,
) -> bool {
pub fn is_property<P, I>(&self, extra_properties: P, semantic: &SemanticModel) -> bool
where
P: IntoIterator<IntoIter = I>,
I: Iterator<Item = QualifiedName<'a>> + Clone,
{
self.as_function_def()
.is_some_and(|StmtFunctionDef { decorator_list, .. }| {
is_property(decorator_list, extra_properties, semantic)