{"record":{"id":"5e2c60cc6adda495","repo":"kovidgoyal/kitty","slug":"empty-include-paths-not-allowed","errorCode":null,"errorMessage":"Empty include paths not allowed","messagePattern":"Empty include paths not allowed","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"tools/config/api.go","lineNumber":136,"sourceCode":"\tif self.seen_includes[name] { // avoid include loops\n\t\treturn nil\n\t}\n\tself.seen_includes[name] = true\n\tif self.AllIncludedFiles != nil && name != OverridesFileName {\n\t\tself.AllIncludedFiles.Add(name)\n\t}\n\n\trecurse := func(r io.Reader, nname, base_path_for_includes string) error {\n\t\tif depth > 32 {\n\t\t\treturn fmt.Errorf(\"Too many nested include directives while processing config file: %s\", name)\n\t\t}\n\t\tescanner := bufio.NewScanner(r)\n\t\treturn self.parse(escanner, nname, base_path_for_includes, depth+1)\n\t}\n\n\tmake_absolute := func(path string) (string, error) {\n\t\tif path == \"\" {\n\t\t\treturn \"\", fmt.Errorf(\"Empty include paths not allowed\")\n\t\t}\n\t\tif !filepath.IsAbs(path) {\n\t\t\tpath = filepath.Join(base_path_for_includes, path)\n\t\t}\n\t\treturn path, nil\n\t}\n\n\tlnum := 0\n\tnext_line_num := 0\n\tnext_line := \"\"\n\tvar line string\n\n\tadd_bad_line := func(err error) {\n\t\tself.bad_lines = append(self.bad_lines, ConfigLine{Src_file: name, Line: line, Line_number: lnum, Err: err})\n\t}\n\n\tfor {\n\t\tif next_line != \"\" {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/tools/config/api.go#L118-L154","documentation":"An include directive in a kitty config file had an empty path. The parser resolves each include path to an absolute path relative to the including file, and rejects empty strings.","triggerScenarios":"A line like `include` or `include   ` (only whitespace) in kitten.conf or any included config file.","commonSituations":"Typing `include` intending to add the path later, template placeholders left empty, or trailing include lines with the path accidentally deleted during editing.","solutions":["Open the file reported by the parser and find the include line with no path","Add the intended path or delete the line entirely","If using a template, ensure the placeholder was substituted before loading the config"],"exampleFix":"# before\ninclude\n# after\ninclude themes/dark.conf","handlingStrategy":"validation","validationCode":"line = strings.TrimSpace(line)\nif line == \"include\" || strings.TrimSpace(strings.TrimPrefix(line, \"include\")) == \"\" {\n    return fmt.Errorf(\"include directive with no path\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always specify a path after include","Strip templates of empty directives before shipping configs"],"tags":["config","include","validation","kitty"],"backgroundTag":"config-invalid-directive","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}