{"record":{"id":"8d1f5eccc935c0de","repo":"astral-sh/ruff","slug":"the-section-config-snapshot-directive-does-not","errorCode":null,"errorMessage":"The `{SECTION_CONFIG_SNAPSHOT}` directive does not take a value.","messagePattern":"The `(.+?)` directive does not take a value\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/mdtest/src/parser.rs","lineNumber":615,"sourceCode":"        const HTML_COMMENT_END: &[u8] = b\"-->\";\n\n        while let Some(first) = self.cursor.bump() {\n            match first {\n                '<' if self.cursor.eat_char3('!', '-', '-') => {\n                    if let Some(position) =\n                        memchr::memmem::find(self.cursor.as_bytes(), HTML_COMMENT_END)\n                    {\n                        let html_comment = self.cursor.as_str()[..position].trim();\n                        let (directive, value) = match html_comment.split_once(':') {\n                            Some((directive, value)) => {\n                                (directive.trim(), Some(value.trim().to_string()))\n                            }\n                            None => (html_comment, None),\n                        };\n\n                        match directive {\n                            SECTION_CONFIG_SNAPSHOT => {\n                                anyhow::ensure!(\n                                    value.is_none(),\n                                    \"The `{SECTION_CONFIG_SNAPSHOT}` directive \\\n                                    does not take a value.\"\n                                );\n                                self.process_mdtest_directive(\n                                    MdtestDirective::SnapshotDiagnostics,\n                                    None,\n                                )?;\n                            }\n                            SECTION_CONFIG_PULLTYPES => {\n                                anyhow::ensure!(\n                                    value.is_none(),\n                                    \"The `{SECTION_CONFIG_PULLTYPES}` directive \\\n                                    does not take a value.\"\n                                );\n                                self.process_mdtest_directive(\n                                    MdtestDirective::PullTypesSkip,\n                                    None,","sourceCodeStart":597,"sourceCodeEnd":633,"githubUrl":"https://github.com/astral-sh/ruff/blob/672bb4edf04c84f8b0753346359daee4057158f2/crates/mdtest/src/parser.rs#L597-L633","documentation":"In mdtest files, `<!-- snapshot-diagnostics -->` is a valueless section directive: the parser splits the HTML comment on ':' and rejects the directive when a value was supplied. It is an authoring error in the test markdown, not a behavior of the code under test.","triggerScenarios":"Writing `<!-- snapshot-diagnostics: on -->` or any text after a colon in the HTML comment form of the directive.","commonSituations":"Copy-pasting from keyed directives of other tools; assuming all mdtest directives take values; converting inline comments to HTML comment form and keeping a value.","solutions":["Remove the colon and value: use exactly `<!-- snapshot-diagnostics -->`","Copy the directive syntax from a nearby passing mdtest file"],"exampleFix":"<!-- before -->\n<!-- snapshot-diagnostics: on -->\n\n<!-- after -->\n<!-- snapshot-diagnostics -->","handlingStrategy":"validation","validationCode":"# reject valued forms of the directive in CI\n! grep -rnE 'snapshot-diagnostics[[:space:]]*:[[:space:]]*[^[:space:]]' \\\n  crates/ty_python_semantic/resources/mdtest/ || {\n  echo 'snapshot-diagnostics takes no value' >&2; exit 1;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write `<!-- snapshot-diagnostics -->` with no colon or value","Copy directive syntax from existing passing mdtest files","Run the mdtest suite locally (cargo nextest run -p ty_python_semantic --test mdtest) before pushing new tests"],"tags":["mdtest","testing","authoring"],"backgroundTag":null,"analyzedSha":"672bb4edf04c84f8b0753346359daee4057158f2","analyzedAt":"2026-08-16T08:54:05.464Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}