{"record":{"id":"bab241a6cd5dbb61","repo":"slint-ui/slint","slug":"no-reuse-toml-file-found-in-current-directory","errorCode":null,"errorMessage":"No REUSE.toml file found in current directory","messagePattern":"No REUSE\\.toml file found in current directory","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"xtask/src/reuse_compliance_check.rs","lineNumber":364,"sourceCode":"    Ok(())\n}\n\n#[derive(Debug, clap::Parser)]\npub struct ReuseComplianceCheck {\n    #[arg(long, action)]\n    fix_symlinks: bool,\n    #[arg(long, action)]\n    download_missing_licenses: bool,\n}\n\nimpl ReuseComplianceCheck {\n    pub fn check_reuse_compliance(&self) -> Result<()> {\n        if !std::env::current_dir()\n            .context(\"Can not access current work directory\")?\n            .join(\"REUSE.toml\")\n            .is_file()\n        {\n            anyhow::bail!(\"No REUSE.toml file found in current directory\");\n        }\n\n        let sh = Shell::new()?;\n\n        let reuse = find_reuse().context(\"Can not find reuse. Please make sure it is installed\")?;\n\n        println!(\"Reuse binary \\\"{}\\\".\", reuse.to_string_lossy());\n\n        if self.download_missing_licenses {\n            let output = reuse_download(&sh, &reuse)?;\n            println!(\"{output}\");\n        }\n\n        reuse_lint(&sh, &reuse)?;\n\n        scan_symlinks(&sh, &reuse, self.fix_symlinks)\n    }\n}","sourceCodeStart":346,"sourceCodeEnd":382,"githubUrl":"https://github.com/slint-ui/slint/blob/bb937076de3f7919766c1f25e2e969367cf77e9a/xtask/src/reuse_compliance_check.rs#L346-L382","documentation":"check_reuse_compliance requires a REUSE.toml file in the current working directory, since the xtask REUSE workflow is configured per-directory through REUSE.toml. This bail fires early, before even looking for the reuse binary, when the CWD has no REUSE.toml.","triggerScenarios":"Running `cargo xtask reuse-compliance-check` from a directory that does not contain REUSE.toml — typically from the repository root when REUSE.toml only exists in subdirectories, or after the file was deleted/renamed.","commonSituations":"Executing the xtask from the wrong directory; REUSE.toml not yet created for the project; file renamed (e.g. .reuse/dep5 deprecated layout without REUSE.toml); CI checkout step skipped the file.","solutions":["Run the command from the directory containing REUSE.toml, or ensure the repo root has a REUSE.toml","Create a REUSE.toml declaring copyright/licensing info (see REUSE specification) if none exists","In CI, verify the checkout preserves REUSE.toml before invoking the xtask"],"exampleFix":"// before\ncd repo && cargo xtask reuse-compliance-check   # no REUSE.toml in repo/\n// after\n# add a REUSE.toml at the repo root or cd into the directory that has one\nprintf 'version = 1\\n[[annotations]]\\npath = [\"**\"]\\nSPDX-FileCopyrightText = \"...\"\\nSPDX-License-Identifier = \"...\"\\n' > REUSE.toml","handlingStrategy":"validation","validationCode":"if !std::path::Path::new(\"REUSE.toml\").is_file() {\n    eprintln!(\"Run from a directory containing REUSE.toml\");\n    std::process::exit(1);\n}","typeGuard":null,"tryCatchPattern":"match run_reuse_check() {\n    Err(e) if e.to_string().contains(\"No REUSE.toml\") => eprintln!(\"cd into the licensed directory or create REUSE.toml first\"),\n    other => other?,\n}","preventionTips":["Run xtask reuse-compliance-check from the directory that owns REUSE.toml","Create a REUSE.toml at the repo root if whole-tree checks are expected","Add REUSE.toml existence to CI setup steps before invoking the check"],"tags":["reuse","licensing","config","cwd"],"backgroundTag":"config-file-not-found","analyzedSha":"bb937076de3f7919766c1f25e2e969367cf77e9a","analyzedAt":"2026-09-16T01:37:20.251Z","contentChangedAt":"2026-09-16T01:37:20.251Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}