{"record":{"id":"3ba6ac1f6493c122","repo":"linera-io/linera-protocol","slug":"project-name-name-should-not-have-a-file-extensi","errorCode":null,"errorMessage":"Project name {name} should not have a file extension","messagePattern":"Project name (.+?) should not have a file extension","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"linera-service/src/project.rs","lineNumber":45,"sourceCode":"        dir: Option<PathBuf>,\n    ) -> Result<Self> {\n        ensure!(\n            !name.contains(std::path::is_separator),\n            \"Project name {name} should not contain path-separators\",\n        );\n        let root = match dir {\n            Some(dir) => dir,\n            None => {\n                let root = PathBuf::from(name);\n                ensure!(\n                    !root.exists(),\n                    \"Directory {} already exists\",\n                    root.display(),\n                );\n                root\n            }\n        };\n        ensure!(\n            root.extension().is_none(),\n            \"Project name {name} should not have a file extension\",\n        );\n        debug!(\"Creating directory at {}\", root.display());\n        fs_err::create_dir_all(&root)?;\n\n        debug!(\"Creating the source directory\");\n        let source_directory = Self::create_source_directory(&root)?;\n\n        debug!(\"Creating the tests directory\");\n        let test_directory = Self::create_test_directory(&root)?;\n\n        debug!(\"Initializing git repository\");\n        Self::initialize_git_repository(&root)?;\n\n        debug!(\"Writing Cargo.toml\");\n        Self::create_cargo_toml(&root, name, linera_root)?;\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/linera-io/linera-protocol/blob/6c226ddcb332ef55118dc8d0aafbd093d5420899/linera-service/src/project.rs#L27-L63","documentation":"create_new rejects project names that parse as having a file extension (Path::extension() returns Some), because the name becomes a directory and a dotted name like `my.app` would look like a file path. Any final dot-separated component triggers the rejection.","triggerScenarios":"`linera project new my.app`, `my-dapp-0.1`, or any name whose last '.'-separated component is treated as an extension.","commonSituations":"Appending version numbers ('app-1.0') or dotted codenames to project names when scaffolding.","solutions":["Strip the dotted suffix: use `my-app` instead of `my.app` or `my-dapp-1.0`","Replace dots with dashes in the name"],"exampleFix":"# before\n$ linera project new my-dapp-1.0\nerror: Project name my-dapp-1.0 should not have a file extension\n\n# after\n$ linera project new my-dapp-1-0","handlingStrategy":"validation","validationCode":"if std::path::Path::new(name).extension().is_some() {\n    anyhow::bail!(\"project name must not contain a file extension: {name}\");\n}","typeGuard":"fn is_valid_project_name(name: &str) -> bool {\n    !name.is_empty()\n        && !name.contains(std::path::is_separator)\n        && std::path::Path::new(name).extension().is_none()\n}","tryCatchPattern":null,"preventionTips":["Use dashes instead of dots in project names","Avoid embedding version numbers in scaffold names"],"tags":["cli","project","validation","scaffolding"],"backgroundTag":"invalid-project-name","analyzedSha":"6c226ddcb332ef55118dc8d0aafbd093d5420899","analyzedAt":"2026-08-22T22:49:09.787Z","schemaVersion":2},"datasetVersion":"2026-08-23T01:17:44.959Z"}