{"record":{"id":"c6182f8b75f8708b","repo":"rust-lang/rust","slug":"file-missing-filecopyrighttext","errorCode":null,"errorMessage":"file missing FileCopyrightText","messagePattern":"file missing FileCopyrightText","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/tools/collect-license-metadata/src/spdx/mod.rs","lineNumber":97,"sourceCode":"        }\n        text.push('\\n');\n        text.push_str(line);\n    }\n\n    anyhow::bail!(\"unexpected end of input inside <text> block\")\n}\n\nfn build_file_entry(\n    name: String,\n    concluded_license: Option<String>,\n    copyright_text: Option<String>,\n) -> Result<SpdxFileEntry, Error> {\n    Ok(SpdxFileEntry {\n        name,\n        concluded_license: concluded_license\n            .ok_or_else(|| anyhow::anyhow!(\"file missing LicenseConcluded\"))?,\n        copyright_text: copyright_text\n            .ok_or_else(|| anyhow::anyhow!(\"file missing FileCopyrightText\"))?,\n    })\n}\n\n#[cfg(test)]\nmod tests;\n","sourceCodeStart":79,"sourceCodeEnd":103,"githubUrl":"https://github.com/rust-lang/rust/blob/7088e4b63a9516ebfbfe2ab2d999cf01a528ac14/src/tools/collect-license-metadata/src/spdx/mod.rs#L79-L103","documentation":"Thrown by build_file_entry when a file section has a FileName but no FileCopyrightText tag was recorded. REUSE emits FileCopyrightText for every file (from SPDX-FileCopyrightText annotations or a default); its absence means the file lacks copyright metadata or REUSE failed to populate it.","triggerScenarios":"A tracked file has no SPDX-FileCopyrightText annotation and no applicable default copyright; REUSE was run in a mode that omits copyright; the file is new and headers were not added.","commonSituations":"New file committed without a copyright header; REUSE configuration missing a default copyright; a vendored third-party file without REUSE-compliant copyright info.","solutions":["Add an SPDX-FileCopyrightText annotation to the offending file (e.g. in its header or a .reuse/dep5 entry).","Configure a default copyright in REUSE so uncovered files inherit it.","Re-run REUSE and confirm FileCopyrightText now appears for the file."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"// Count FileCopyrightText tags vs FileName tags.\nlet files = input.lines().filter(|l| l.starts_with(\"FileName:\")).count();\nlet copyrights = input.lines().filter(|l| l.starts_with(\"FileCopyrightText:\")).count();\nif copyrights < files {\n    eprintln!(\"{files} files but only {copyrights} FileCopyrightText tags; add copyright headers\");\n}","typeGuard":null,"tryCatchPattern":"match crate::spdx::parse_tag_value(raw) {\n    Err(e) if e.to_string().contains(\"missing FileCopyrightText\") => {\n        eprintln!(\"{e:#}. Add SPDX-FileCopyrightText to the offending file(s).\");\n        return Err(e);\n    }\n    other => other?,\n}","preventionTips":["Add SPDX-FileCopyrightText headers to all new files.","Configure a default copyright in REUSE for files without explicit text.","Run collect-license-metadata locally before pushing license-affecting changes."],"tags":["collect-license-metadata","spdx","licensing","copyright"],"backgroundTag":null,"analyzedSha":"7088e4b63a9516ebfbfe2ab2d999cf01a528ac14","analyzedAt":"2026-08-10T14:17:03.603Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}