{"record":{"id":"59332c71ac8e3e84","repo":"astral-sh/ruff","slug":"unexpected-suffix-suffix-on-string-literal","errorCode":null,"errorMessage":"unexpected suffix `{suffix}` on string literal","messagePattern":"unexpected suffix `(.+?)` on string literal","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/ruff_macros/src/config.rs","lineNumber":343,"sourceCode":"fn get_string_literal(\n    meta: &ParseNestedMeta,\n    meta_name: &str,\n    attribute_name: &str,\n) -> syn::Result<syn::LitStr> {\n    let expr: syn::Expr = meta.value()?.parse()?;\n\n    let mut value = &expr;\n    while let syn::Expr::Group(e) = value {\n        value = &e.expr;\n    }\n\n    if let syn::Expr::Lit(ExprLit {\n        lit: Lit::Str(lit), ..\n    }) = value\n    {\n        let suffix = lit.suffix();\n        if !suffix.is_empty() {\n            return Err(syn::Error::new(\n                lit.span(),\n                format!(\"unexpected suffix `{suffix}` on string literal\"),\n            ));\n        }\n\n        Ok(lit.clone())\n    } else {\n        Err(syn::Error::new(\n            expr.span(),\n            format!(\"expected {attribute_name} attribute to be a string: `{meta_name} = \\\"...\\\"`\"),\n        ))\n    }\n}\n\n#[derive(Default, Debug)]\nstruct DeprecatedAttribute {\n    since: Option<String>,\n    note: Option<String>,","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/astral-sh/ruff/blob/26f38c119cac42e4d320ba08f09224fdec74af2c/crates/ruff_macros/src/config.rs#L325-L361","documentation":"A syn compile error from get_string_literal in the option macros: a value passed to default/value_type/scope/example is a string literal with a suffix attached after the closing quote. The macros require plain string literals.","triggerScenarios":"Thrown at crates/ruff_macros/src/config.rs:343 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the suffix so the value is a plain string literal","Quote the whole value correctly, e.g. default = \"true\""],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"26f38c119cac42e4d320ba08f09224fdec74af2c","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}