{"record":{"id":"acc374c446648123","repo":"jdx/mise","slug":"path-raw-id-position-is-only-valid-with-lin","errorCode":null,"errorMessage":"\"{path_raw}\".{id}: position is only valid with line, ignoring entry","messagePattern":"\"(.+?)\"\\.(.+?): position is only valid with line, ignoring entry","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/edits.rs","lineNumber":308,"sourceCode":"            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            if entry.position.is_some() {\n                bail!(\"\\\"{path_raw}\\\".{id}: position is only valid with line, ignoring entry\")\n            }\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);\n                    let src = if src.is_relative() {\n                        base.join(src)\n                    } else {\n                        src\n                    };\n                    origin.source = Some(src.clone());\n                    BlockSource::File(src)\n                }","sourceCodeStart":290,"sourceCodeEnd":326,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/edits.rs#L290-L326","documentation":"The `position` field (append/prepend) only applies to line-based edit entries; block/source edits manage their content via marker lines and cannot be positioned. resolve_entry raises this error and ignores the entry when `position` is set together with a block/source entry (is_block=true, no line).","triggerScenarios":"A [dotfiles] entry sets `block` (or `source`) plus `position = \"append\"` or `\"prepend\"` without a `line` field.","commonSituations":"Copy-pasting a line entry and switching it to block but keeping the position setting; assuming position also controls where a block is placed.","solutions":["Remove the `position` field from the block/source entry.","If positioning is truly needed, use a `line` entry with position instead.","Keep `position` only if you also keep `line` and drop block/source."],"exampleFix":"// before\n[[dotfiles]]\nid = \"aliases\"\npath = \"~/.zshrc\"\nblock = \"alias gs='git status'\"\nposition = \"append\"\n\n// after\n[[dotfiles]]\nid = \"aliases\"\npath = \"~/.zshrc\"\nblock = \"alias gs='git status'\"","handlingStrategy":"validation","validationCode":"for entry in dotfile_entries {\n    if (entry.block.is_some() || entry.source.is_some()) && entry.position.is_some() {\n        panic!(\"entry {}: position only applies to line entries\", entry.id);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Associate position only with line entries when writing configs.","Strip position when converting a line entry to a block entry.","Document team config conventions so blocks are never given position."],"tags":["config","validation","dotfiles"],"backgroundTag":"mutually-exclusive-options","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}