mirror of https://github.com/astral-sh/ruff
Add stubs for type params and type aliases
This commit is contained in:
parent
0d4f1d86ad
commit
35cc48a64c
|
|
@ -590,6 +590,7 @@ where
|
||||||
keywords,
|
keywords,
|
||||||
decorator_list,
|
decorator_list,
|
||||||
body,
|
body,
|
||||||
|
type_params: _,
|
||||||
range: _,
|
range: _,
|
||||||
},
|
},
|
||||||
) => {
|
) => {
|
||||||
|
|
|
||||||
|
|
@ -225,6 +225,7 @@ fn function(
|
||||||
decorator_list: vec![],
|
decorator_list: vec![],
|
||||||
returns: Some(Box::new(return_type)),
|
returns: Some(Box::new(return_type)),
|
||||||
type_comment: None,
|
type_comment: None,
|
||||||
|
type_params: vec![],
|
||||||
range: TextRange::default(),
|
range: TextRange::default(),
|
||||||
});
|
});
|
||||||
return generator.stmt(&func);
|
return generator.stmt(&func);
|
||||||
|
|
@ -237,6 +238,7 @@ fn function(
|
||||||
decorator_list: vec![],
|
decorator_list: vec![],
|
||||||
returns: None,
|
returns: None,
|
||||||
type_comment: None,
|
type_comment: None,
|
||||||
|
type_params: vec![],
|
||||||
range: TextRange::default(),
|
range: TextRange::default(),
|
||||||
});
|
});
|
||||||
generator.stmt(&func)
|
generator.stmt(&func)
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,7 @@ fn create_class_def_stmt(typename: &str, body: Vec<Stmt>, base_class: &Expr) ->
|
||||||
keywords: vec![],
|
keywords: vec![],
|
||||||
body,
|
body,
|
||||||
decorator_list: vec![],
|
decorator_list: vec![],
|
||||||
|
type_params: vec![],
|
||||||
range: TextRange::default(),
|
range: TextRange::default(),
|
||||||
}
|
}
|
||||||
.into()
|
.into()
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,7 @@ fn create_class_def_stmt(
|
||||||
keywords,
|
keywords,
|
||||||
body,
|
body,
|
||||||
decorator_list: vec![],
|
decorator_list: vec![],
|
||||||
|
type_params: vec![],
|
||||||
range: TextRange::default(),
|
range: TextRange::default(),
|
||||||
}
|
}
|
||||||
.into()
|
.into()
|
||||||
|
|
|
||||||
|
|
@ -42,6 +42,7 @@ impl FormatRule<Stmt, PyFormatContext<'_>> for FormatStmt {
|
||||||
Stmt::ClassDef(x) => x.format().fmt(f),
|
Stmt::ClassDef(x) => x.format().fmt(f),
|
||||||
Stmt::Return(x) => x.format().fmt(f),
|
Stmt::Return(x) => x.format().fmt(f),
|
||||||
Stmt::Delete(x) => x.format().fmt(f),
|
Stmt::Delete(x) => x.format().fmt(f),
|
||||||
|
Stmt::TypeAlias(_) => todo!(),
|
||||||
Stmt::Assign(x) => x.format().fmt(f),
|
Stmt::Assign(x) => x.format().fmt(f),
|
||||||
Stmt::AugAssign(x) => x.format().fmt(f),
|
Stmt::AugAssign(x) => x.format().fmt(f),
|
||||||
Stmt::AnnAssign(x) => x.format().fmt(f),
|
Stmt::AnnAssign(x) => x.format().fmt(f),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue