{"record":{"id":"41baa48c7ea32ddb","repo":"jdx/mise","slug":"unclosed-brace-alternate-in-glob-pattern-pattern","errorCode":null,"errorMessage":"unclosed brace alternate in glob pattern {pattern:?}","messagePattern":"unclosed brace alternate in glob pattern (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_source_checker.rs","lineNumber":137,"sourceCode":"                        if let Some(mut nested) = find_group(&pattern[start + 1..idx])? {\n                            let offset = start + 1;\n                            nested.start += offset;\n                            nested.end += offset;\n                            for (branch_start, branch_end) in &mut nested.branches {\n                                *branch_start += offset;\n                                *branch_end += offset;\n                            }\n                            return Ok(Some(nested));\n                        }\n                        group_start = None;\n                        branches.clear();\n                    }\n                }\n                _ => {}\n            }\n        }\n        if group_depth != 0 {\n            bail!(\"unclosed brace alternate in glob pattern {pattern:?}\");\n        }\n        Ok(None)\n    }\n\n    fn expand(pattern: &str, expanded: &mut Vec<String>) -> Result<()> {\n        let Some(group) = find_group(pattern)? else {\n            if expanded.len() >= MAX_BRACE_EXPANSIONS {\n                bail!(\n                    \"glob pattern expands to more than {MAX_BRACE_EXPANSIONS} alternatives: {pattern:?}\"\n                );\n            }\n            let mut literal = String::with_capacity(pattern.len());\n            let mut escaped = false;\n            let mut class_depth = 0;\n            for ch in pattern.chars() {\n                if escaped {\n                    escaped = false;\n                    literal.push(ch);","sourceCodeStart":119,"sourceCodeEnd":155,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/task/task_source_checker.rs#L119-L155","documentation":"After scanning the entire pattern, the brace-alternation expander checks that group_depth returned to zero. A non-zero depth means a '{' was opened but never closed, so the alternation is incomplete and the pattern cannot be expanded — mise bails with the offending pattern.","triggerScenarios":"Passing a task glob containing '{' without a matching '}', e.g. `src/{a,b.rs` or `build/{debug` to task source/output/include globs.","commonSituations":"Truncated copy-paste of a glob; editing a pattern and deleting the closing brace; template/variable interpolation leaving a dangling brace in mise.toml globs.","solutions":["Close the brace group: `src/{a,b}.rs`","Escape literal braces with backslash: `\\{literal\\}`","Validate brace balance in the glob before saving the config","If the brace comes from a variable, ensure the variable expands to a complete pattern"],"exampleFix":"// before\noutputs = [\"dist/{js,css\"]\n// after\noutputs = [\"dist/{js,css}\"]","handlingStrategy":"validation","validationCode":"python3 -c \"import sys;p=sys.argv[1];d=0;esc=False\nfor c in p:\n  if esc: esc=False; continue\n  if c=='\\\\': esc=True\n  elif c=='{': d+=1\n  elif c=='}': d-=1\nsys.exit('unclosed brace' if d else None)\" \"$GLOB\"","typeGuard":null,"tryCatchPattern":"python3 brace_check.py \"$GLOB\" || { echo 'unclosed brace' >&2; exit 1; }; mise run build","preventionTips":["Close every '{' you open in globs","Validate patterns after template interpolation","Keep globs simple; split complex patterns into lists","Test glob patterns against sample paths"],"tags":["glob","tasks","pattern-matching"],"backgroundTag":"invalid-regex-pattern","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"}