Add SwiftLint HARD rules
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit

This commit is contained in:
2025-04-30 17:05:02 +02:00
parent c3445042b7
commit 279f13dbd5
79 changed files with 1969 additions and 1384 deletions

View File

@ -5,10 +5,11 @@
// Created by Thibaut Schmitt on 18/11/2022.
//
import ToolCore
import Foundation
import ToolCore
enum ArchitectureGenerator {
struct ArchitectureGenerator {
static func writeArchitecture(_ architecture: ConfigurationArchitecture, projectDirectory: String) {
// Create extension content
var architectureContent = [
@ -16,21 +17,21 @@ struct ArchitectureGenerator {
architecture.getClass()
]
.joined(separator: "\n\n")
architectureContent += "\n"
let filename = "\(architecture.classname).swift"
guard let filePath = architecture.path?.prependIfRelativePath(projectDirectory) else {
let error = GenerateError.writeFile(filename, "Path of file is not defined.")
print(error.description)
Generate.exit(withError: error)
}
// Write content
let architectureFilePathURL = URL(fileURLWithPath: "\(filePath)/\(filename)")
do {
try architectureContent.write(to: architectureFilePathURL, atomically: false, encoding: .utf8)
} catch let error {
} catch {
let error = GenerateError.writeFile(filename, error.localizedDescription)
print(error.description)
Generate.exit(withError: error)