         switch self {
         case .multipleSourceRoots(_):
             return "remove the extra source roots, or add them to the source root exclude list"
-        case .invalidLayout(_):
+        case .unexpectedSourceFiles(_):
             return "move the file(s) inside a module"
         }
     }

        switch self {
        case .multipleSourceRoots(let paths):
            return "multiple source roots found: " + paths.sorted().joined(separator: ", ")
        case .invalidLayout(let paths):
            return "unexpected source file(s) found: " + paths.sorted().joined(separator: ", ")
        }
    }

        if srcDir != packagePath {
            let invalidRootFiles = try directoryContents(packagePath).filter(isValidSource)
            guard invalidRootFiles.isEmpty else {
                throw ModuleError.invalidLayout(.unexpectedSourceFiles(invalidRootFiles.map{ $0.asString }))
            }
        }
        
