{"record":{"id":"da9bce0dc12f830c","repo":"matryer/xbar","slug":"missing-xbar-author","errorCode":null,"errorMessage":"missing xbar.author","messagePattern":"missing xbar\\.author","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/metadata/plugin_metadata.go","lineNumber":80,"sourceCode":"\n\t// ProcessingNotes is a list of errors/warnings/notes that are set during\n\t// the processing of this plugin.\n\tProcessingNotes []string `json:\"processingNotes\"`\n}\n\n// Validate checks the plugin data.\nfunc (p Plugin) Validate() error {\n\tif p.Title == \"\" {\n\t\treturn errors.New(\"missing xbar.title\")\n\t}\n\tif p.Desc == \"\" {\n\t\treturn errors.New(\"missing xbar.desc\")\n\t}\n\tif !HasImage(p.ImageURL) {\n\t\treturn errors.New(\"missing xbar.image\")\n\t}\n\tif len(p.Authors) == 0 {\n\t\treturn errors.New(\"missing xbar.author\")\n\t}\n\treturn nil // ok\n}\n\n// NiceDesc gets a nice description.\nfunc (p Plugin) NiceDesc() string {\n\tif p.Desc == \"\" {\n\t\treturn p.Title\n\t}\n\treturn truncate(p.Desc, 75)\n}\n\n// File is a single file.\ntype File struct {\n\t// Path is the path of the File.\n\tPath string `json:\"path\"`\n\t// Filename is the file name of this File.\n\tFilename string `json:\"filename\"`","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/matryer/xbar/blob/d624239058997c80118eaebe2e7f8331b3c765e0/pkg/metadata/plugin_metadata.go#L62-L98","documentation":"Plugin.Validate requires at least one author, i.e. len(p.Authors) > 0. Authorship is required for the directory listing, so a plugin with no <xbar.author> metadata fails validation. This is the last check before Validate returns nil.","triggerScenarios":"Plugin.Validate called on a Plugin whose Authors slice is empty — the script has no <xbar.author>...</xbar.author> comment, or it contains no name/username and Parse produced zero authors.","commonSituations":"Forked plugins where the original author line was deleted; new plugin templates lacking the author comment; author username accidentally removed; Plugin structs constructed by hand without appending any Author.","solutions":["Add an <xbar.author>Your Name, github-username</xbar.author> comment block to the plugin script","Append at least one Author to the Plugin's Authors slice before Validate","Re-parse the fixed source and Validate again"],"exampleFix":"// before (plugin script metadata)\n// <xbar.author></xbar.author>\n// after\n// <xbar.author>Jane Doe, janedoe</xbar.author>","handlingStrategy":"validation","validationCode":"func hasAuthor(src string) bool {\n\treturn regexp.MustCompile(`(?s)<xbar\\.author>\\s*\\S.*?</xbar\\.author>`).MatchString(src)\n}","typeGuard":"func hasValidAuthors(p metadata.Plugin) bool {\n\treturn len(p.Authors) > 0\n}","tryCatchPattern":"if err := plugin.Validate(); err != nil {\n\tif err.Error() == \"missing xbar.author\" {\n\t\treturn fmt.Errorf(\"plugin %s: add an <xbar.author>Name, username</xbar.author> comment: %w\", path, err)\n\t}\n\treturn err\n}","preventionTips":["Forks must update the <xbar.author> line to credit the maintainer","Include both a name and a username (comma-separated) in the author comment","Validate authorship in CI before publishing","Never delete the author comment during cleanup"],"tags":["metadata","validation","plugin","go"],"backgroundTag":"missing-metadata-field","analyzedSha":"d624239058997c80118eaebe2e7f8331b3c765e0","analyzedAt":"2026-09-02T22:38:22.007Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}