mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
[numpy
] deprecated type aliases (#2810)
Closes https://github.com/charliermarsh/ruff/issues/2455 Used `NPY` as prefix code as agreed in the issue.
This commit is contained in:
parent
c0eb5c28d1
commit
ac028cd9f8
15 changed files with 344 additions and 9 deletions
|
@ -15,8 +15,9 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
|
|||
let mut parsed = Vec::new();
|
||||
|
||||
let mut common_prefix_match_arms = quote!();
|
||||
let mut name_match_arms = quote!(Self::Ruff => "Ruff-specific rules",);
|
||||
let mut url_match_arms = quote!(Self::Ruff => None,);
|
||||
let mut name_match_arms =
|
||||
quote!(Self::Ruff => "Ruff-specific rules", Self::Numpy => "NumPy-specific rules", );
|
||||
let mut url_match_arms = quote!(Self::Ruff => None, Self::Numpy => None, );
|
||||
|
||||
let mut all_prefixes = HashSet::new();
|
||||
|
||||
|
@ -58,7 +59,7 @@ pub fn derive_impl(input: DeriveInput) -> syn::Result<proc_macro2::TokenStream>
|
|||
|
||||
let variant_ident = variant.ident;
|
||||
|
||||
if variant_ident != "Ruff" {
|
||||
if variant_ident != "Ruff" && variant_ident != "Numpy" {
|
||||
let (name, url) = parse_doc_attr(doc_attr)?;
|
||||
name_match_arms.extend(quote! {Self::#variant_ident => #name,});
|
||||
url_match_arms.extend(quote! {Self::#variant_ident => Some(#url),});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue