{"record":{"id":"a333a028ffcc2a2e","repo":"jdx/mise","slug":"path-raw-id-block-source-and-line-are-mutua","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: block/source and line are mutually exclusive, ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): block/source and line are mutually exclusive, ignoring entry","errorType":"validation","errorClass":"eyre::Report","httpStatus":null,"severity":"warning","filePath":"src/system/edits.rs","lineNumber":244,"sourceCode":"    if id.is_empty() || !id.chars().all(|c| c.is_alphanumeric() || \"_-.\".contains(c)) {\n        bail!(\n            \"\\\"{path_raw}\\\".{id:?}: ids may only contain letters, digits, '_', '-', and '.', ignoring entry\"\n        );\n    }\n    let entry = match entry {\n        EditTomlEntry::Block(inline) => EditTomlTable {\n            block: Some(inline),\n            source: None,\n            template: None,\n            line: None,\n            comment: None,\n        },\n        EditTomlEntry::Table(table) => table,\n    };\n    let is_block = entry.block.is_some() || entry.source.is_some();\n    let op = match (&is_block, &entry.line) {\n        (true, Some(_)) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: block/source and line are mutually exclusive, ignoring entry\"\n            )\n        }\n        (false, None) => {\n            bail!(\n                \"\\\"{path_raw}\\\".{id}: no recognized operation (block, source, or line), ignoring entry\"\n            )\n        }\n        (true, None) => {\n            let source = match (entry.block, entry.source) {\n                (Some(_), Some(_)) => {\n                    bail!(\n                        \"\\\"{path_raw}\\\".{id}: block and source are mutually exclusive, ignoring entry\"\n                    )\n                }\n                (Some(inline), None) => BlockSource::Inline(inline),\n                (None, Some(src)) => {\n                    let src = file::replace_path(&src);","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/jdx/mise/blob/9dcfcaa0dc8747a2577d3270b69bb9d8313b2807/src/system/edits.rs#L226-L262","documentation":"A [dotfiles] edit entry is either a block (inline block = or file-backed source =) or a single-line insert (line =). Setting block/source together with line is rejected because a region cannot be both marker-delimited content and an exact-match line; the entry is warned about and skipped.","triggerScenarios":"An entry like { block = 'export PATH=...', line = 'export PATH=...' } or { source = \"a.sh\", line = \"...\" } in [dotfiles].","commonSituations":"Evolving a line edit into a block edit and leaving the old key in place; copy-pasting a combined example; intent to have both effects without realizing they need separate entries.","solutions":["Split into two entries with different ids — one block, one line — on the same file","Or delete the key you do not want"],"exampleFix":"# before\n[dotfiles]\n\"~/.zshrc/activate\" = { block = 'eval \"$(mise activate zsh)\"', line = 'eval \"$(mise activate zsh)\"' }\n\n# after\n[dotfiles]\n\"~/.zshrc/activate\" = { block = 'eval \"$(mise activate zsh)\"' }","handlingStrategy":"validation","validationCode":"# an entry may combine block/source with template/comment, but not with line\npython3 - <<'EOF'\nimport tomllib\nfor key, v in tomllib.load(open('mise.toml','rb')).get('dotfiles', {}).items():\n    if isinstance(v, dict):\n        blockish = 'block' in v or 'source' in v\n        assert not (blockish and 'line' in v), f'mutually exclusive: {key}'\nEOF","typeGuard":null,"tryCatchPattern":null,"preventionTips":["One operation per entry id; add a second entry with a distinct id for the other op","When upgrading a line edit to a block edit, delete the line key in the same commit"],"tags":["dotfiles","edits","mutually-exclusive","validation"],"backgroundTag":"mutually-exclusive-config-keys","analyzedSha":"9dcfcaa0dc8747a2577d3270b69bb9d8313b2807","analyzedAt":"2026-08-17T14:28:50.624Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}