astral-sh/ruff · error · syn::Error

Deprecated meta {:?} is not supported by ruff's option macro

Error message

Deprecated meta {:?} is not supported by ruff's option macro.

What it means

A syn compile error from parse_field_attributes in the #[option(...)] macro: an unrecognized meta item was found in the attribute. Only default, value_type, scope, and example are accepted; older spellings are deliberately rejected with this message.

Source

Thrown at crates/ruff_macros/src/config.rs:261

fn parse_field_attributes(attribute: &Attribute) -> syn::Result<FieldAttributes> {
    let mut default = None;
    let mut value_type = None;
    let mut example = None;
    let mut scope = None;

    attribute.parse_nested_meta(|meta| {
        if meta.path.is_ident("default") {
            default = Some(get_string_literal(&meta, "default", "option")?.value());
        } else if meta.path.is_ident("value_type") {
            value_type = Some(get_string_literal(&meta, "value_type", "option")?.value());
        } else if meta.path.is_ident("scope") {
            scope = Some(get_string_literal(&meta, "scope", "option")?.value());
        } else if meta.path.is_ident("example") {
            let example_text = get_string_literal(&meta, "value_type", "option")?.value();
            example = Some(dedent(&example_text).trim_matches('\n').to_string());
        } else {
            return Err(syn::Error::new(
                meta.path.span(),
                format!(
                    "Deprecated meta {:?} is not supported by ruff's option macro.",
                    meta.path.get_ident()
                ),
            ));
        }

        Ok(())
    })?;

    let Some(default) = default else {
        return Err(syn::Error::new(
            attribute.span(),
            "Mandatory `default` field is missing in `#[option]` attribute. Specify the default using `#[option(default=\"..\")]`.",
        ));
    };

View on GitHub (pinned to 26f38c119c)

Solutions

  1. Remove the unsupported key from the #[option(...)] attribute
  2. Use one of the supported keys: default, value_type, scope, example
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at crates/ruff_macros/src/config.rs:261 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of astral-sh/ruff@26f38c119c (2026-09-05). Data as JSON: /api/errors/3477826e50186871. Report an issue: GitHub.