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,13 +5,14 @@
// Created by Thibaut Schmitt on 29/08/2022.
//
import Foundation
import ArgumentParser
import Foundation
enum ColorStyle: String, Decodable, ExpressibleByArgument {
case light
case all
static var allValueStrings: [String] {
[
Self.light.rawValue,

View File

@@ -8,28 +8,29 @@
import Foundation
struct ParsedColor {
let name: String
let light: String
let dark: String
// Generate Contents.json content
func contentsJSON() -> String {
let lightARGB = light.colorComponent()
let darkARGB = dark.colorComponent()
let allComponents = [
lightARGB.alpha, lightARGB.red, lightARGB.green, lightARGB.blue,
darkARGB.alpha, darkARGB.red, darkARGB.green, darkARGB.blue
].map {
$0.isEmpty
}
guard allComponents.contains(true) == false else {
let error = ColorsToolError.badColorDefinition(light, dark)
print(error.description)
Colors.exit(withError: error)
}
return """
{
"colors": [
@@ -71,9 +72,9 @@ struct ParsedColor {
}
"""
}
// MARK: - UIKit
func getColorProperty(isStatic: Bool, isSwiftUI: Bool) -> String {
if isSwiftUI {
return """