{"record":{"id":"c96349a6eeb739e6","repo":"jdx/mise","slug":"packslip-plugin-version-must-not-be-empty","errorCode":null,"errorMessage":"packslip plugin version must not be empty","messagePattern":"packslip plugin version must not be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/plugins/packslip.rs","lineNumber":37,"sourceCode":"\n#[derive(Debug, Clone, Serialize, Deserialize)]\npub(crate) struct Source {\n    project: String,\n    request: String,\n}\n\nimpl Source {\n    pub(crate) fn parse(value: &str) -> Result<Option<Self>> {\n        let Some(value) = value.strip_prefix(\"packslip:\") else {\n            return Ok(None);\n        };\n        let (project, request) = value.split_once('#').unwrap_or((value, \"latest\"));\n        let project = project_name(project)?;\n        ensure!(\n            project.starts_with(\"github.com/\") && packslip::model::repository(&project).is_some(),\n            \"packslip plugin sources currently require a GitHub repository\"\n        );\n        ensure!(\n            !request.is_empty(),\n            \"packslip plugin version must not be empty\"\n        );\n        Ok(Some(Self {\n            project,\n            request: request.to_owned(),\n        }))\n    }\n\n    pub(crate) fn url(&self) -> String {\n        format!(\"packslip:{}#{}\", self.project, self.request)\n    }\n\n    pub(crate) fn with_version(mut self, version: Option<String>) -> Self {\n        if let Some(version) = version {\n            self.request = version;\n        }\n        self","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/plugins/packslip.rs#L19-L55","documentation":"After parsing a packslip source's project part, PackslipSource::parse (src/plugins/packslip.rs:37) validates the version request after the `#` separator. If the user wrote `packslip:github.com/org/repo#` with nothing following, the request is an empty string and mise rejects it — an empty version request is never valid (use the repo alone for `latest`).","triggerScenarios":"Specifying a packslip source with a trailing `#` and no version, e.g. `mise use packslip:github.com/org/repo#` in mise.toml or on the CLI. Empty string after split_once('#') triggers the ensure!.","commonSituations":"Autocomplete/template residue leaving a dangling `#`; a hand-edited mise.toml where the version was deleted but the separator kept; copy-paste truncation cutting off the version string.","solutions":["Remove the trailing `#` entirely — `packslip:github.com/org/repo` defaults to `latest`.","Or supply a concrete version after the `#`, e.g. `packslip:github.com/org/repo#1.2.3`.","Validate your mise.toml with `mise ls` or `mise doctor` after edits to catch malformed tool specs early.","If a variable builds the spec, guard against empty version interpolation before formatting the source string."],"exampleFix":"// before\n[tools]\nmytool = \"packslip:github.com/acme/mytool#\"\n// after\n[tools]\nmytool = \"packslip:github.com/acme/mytool\"","handlingStrategy":"validation","validationCode":"fn has_nonempty_request(src: &str) -> bool {\n  src.strip_prefix(\"packslip:\")\n    .map_or(false, |rest| {\n      rest.split_once('#').map_or(true, |(_, req)| !req.is_empty())\n    })\n}","typeGuard":null,"tryCatchPattern":"match parse_source(spec) {\n  Err(e) if e.to_string().contains(\"must not be empty\") => {\n    eprintln!(\"drop the trailing '#' or provide a version after it\");\n  }\n  other => other?,\n}","preventionTips":["Omit the '#' entirely when you want the default (latest)","Lint mise.toml tool specs for dangling separators after edits","Guard version interpolation in generated specs against empty strings"],"tags":["registry","packslip","version","empty-value"],"backgroundTag":"empty-required-field","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}