{"record":{"id":"fa96cbb013b12f51","repo":"astral-sh/ruff","slug":"required-version-required-version-does-not-mat","errorCode":null,"errorMessage":"Required version `{required_version}` does not match the running version `{RUFF_PKG_VERSION}`","messagePattern":"Required version `(.+?)` does not match the running version `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/ruff_workspace/src/options.rs","lineNumber":620,"sourceCode":"    /// For example, `TC001`, `TC002`, and `TC003` can move more imports into `TYPE_CHECKING` blocks\n    /// if `__future__` annotations are enabled.\n    ///\n    #[option(\n        default = \"false\",\n        value_type = \"bool\",\n        example = r#\"\n            # Enable `from __future__ import annotations` imports\n            future-annotations = true\n        \"#\n    )]\n    pub future_annotations: Option<bool>,\n}\n\npub(crate) fn validate_required_version(required_version: &RequiredVersion) -> anyhow::Result<()> {\n    let ruff_pkg_version = pep440_rs::Version::from_str(RUFF_PKG_VERSION)\n        .expect(\"RUFF_PKG_VERSION is not a valid PEP 440 version specifier\");\n    if !required_version.contains(&ruff_pkg_version) {\n        return Err(anyhow::anyhow!(\n            \"Required version `{required_version}` does not match the running version \\\n            `{RUFF_PKG_VERSION}`\"\n        ));\n    }\n    Ok(())\n}\n\n/// Newtype wrapper for [`LintCommonOptions`] that allows customizing the JSON schema and omitting the fields from the [`OptionsMetadata`].\n#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize)]\n#[serde(transparent)]\npub struct DeprecatedTopLevelLintOptions(pub(crate) LintCommonOptions);\n\nimpl<'de> Deserialize<'de> for DeprecatedTopLevelLintOptions {\n    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>\n    where\n        D: Deserializer<'de>,\n    {\n        // Temporarily disable span information because the flattened values don't retain spans.","sourceCodeStart":602,"sourceCodeEnd":638,"githubUrl":"https://github.com/astral-sh/ruff/blob/5bb508f59481c1a02d5c7ff8568b9ffd8a763eef/crates/ruff_workspace/src/options.rs#L602-L638","documentation":"An anyhow error from validate_required_version: the `required-version` setting in the configuration does not match the version of the running Ruff binary. It is a guard against silently running a different Ruff than the project pins.","triggerScenarios":"Thrown at crates/ruff_workspace/src/options.rs:620 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Install and run the Ruff version specified by required-version","Update required-version in the configuration to match the installed Ruff"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5bb508f59481c1a02d5c7ff8568b9ffd8a763eef","analyzedAt":"2026-09-05T10:32:37.492Z","contentChangedAt":"2026-09-05T10:32:37.492Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}