{"record":{"id":"b70d0a9657e4eb58","repo":"loco-rs/loco","slug":"skip-marker-needs-a-reason-write-it-as-rust-skip-marker-why","errorCode":null,"errorMessage":"{}:{}: `{SKIP_MARKER}` needs a reason — write it as ```rust {SKIP_MARKER}=\"why this is not Rust\"","messagePattern":"(.+?):(.+?): `(.+?)` needs a reason — write it as ```rust (.+?)=\"why this is not Rust\"","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/docs_syntax.rs","lineNumber":190,"sourceCode":"            \"rs\" => doc_comments_only(&fs::read_to_string(&path)?),\n            _ => continue,\n        };\n        let lines: Vec<&str> = contents.lines().collect();\n        let mut index = 0;\n        while index < lines.len() {\n            if !fence.is_match(lines[index]) {\n                index += 1;\n                continue;\n            }\n            let opened_at = index;\n            // A bare `no-syntax-check` with no reason is rejected rather than\n            // honoured — see the module docs.\n            let skipped = match lines[opened_at].find(SKIP_MARKER) {\n                None => false,\n                Some(at) => {\n                    let reason = reason_at(&lines[opened_at][at + SKIP_MARKER.len()..]);\n                    if reason.is_none() {\n                        bail!(\n                            \"{}:{}: `{SKIP_MARKER}` needs a reason — write it as \\\n                             ```rust {SKIP_MARKER}=\\\"why this is not Rust\\\"\",\n                            path.display(),\n                            opened_at + 1\n                        );\n                    }\n                    true\n                }\n            };\n            index += 1;\n            let start = index;\n            while index < lines.len() && !closing.is_match(lines[index]) {\n                index += 1;\n            }\n            if index >= lines.len() {\n                bail!(\n                    \"{}:{}: ```rust block is never closed\",\n                    path.display(),","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/loco-rs/loco/blob/23639d1e360dbc618073642b507d6f8664adbaff/xtask/src/docs_syntax.rs#L172-L208","documentation":"The docs-syntax checker supports opting a Rust block out of checking by annotating the fence with a skip marker; this bail fires when the marker is present but carries no reason. The tool requires the reason attribute so that every opt-out is documented and auditable.","triggerScenarios":"Writing ```` ```rust skip ```` (or with an empty/unparseable reason) in a docs markdown file, causing `reason_at` to return `None` when `collect` processes the file.","commonSituations":"Adding a skip marker in a hurry while fixing CI; copying an old-style marker without a quoted reason; forgetting the `=\"reason\"` attribute.","solutions":["Change the fence to ```` ```rust skip=\"<reason>\" ```` with a non-empty quoted reason","Alternatively remove the skip marker entirely if the block is valid Rust and should be checked"],"exampleFix":"// before\n```rust skip\nlet x = \"not compilable\";\n```\n// after\n```rust skip=\"illustrative pseudo-code, not compilable\"\nlet x = \"not compilable\";\n```","handlingStrategy":"validation","validationCode":"grep -rnE '^```rust\\s+skip\\s*$' docs/ && echo 'skip markers missing reasons'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always write skip=\"reason\" when opting a block out","Lint docs/ for bare skip markers in CI"],"tags":["docs","markdown","validation","tooling"],"backgroundTag":"missing-required-argument","analyzedSha":"23639d1e360dbc618073642b507d6f8664adbaff","analyzedAt":"2026-09-12T01:47:20.769Z","contentChangedAt":"2026-09-12T01:47:20.769Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}