chore: add swiftlint

Signed-off-by: Alan Brault <alan.brault@visus.io>
This commit is contained in:
2026-08-08 09:25:40 -04:00
parent 0aa242b694
commit 59cb2737a1
5 changed files with 162 additions and 19 deletions
+90
View File
@@ -0,0 +1,90 @@
included:
- Tempestas
- Packages/TempestasDomain/Sources
- Packages/TempestasDomain/Tests
- Packages/TempestasInfrastructure/Sources
- Packages/TempestasInfrastructure/Tests
- Packages/TempestasPresentation/Sources
- Packages/TempestasPresentation/Tests
- TempestasTests
- TempestasUITests
excluded:
- "**/.build"
- "**/.swiftpm"
- "**/DerivedData"
opt_in_rules:
- array_init
- closure_end_indentation
- closure_spacing
- collection_alignment
- contains_over_filter_count
- contains_over_filter_is_empty
- contains_over_first_not_nil
- convenience_type
- discouraged_optional_boolean
- empty_count
- empty_string
- enum_case_associated_values_count
- explicit_init
- fatal_error_message
- first_where
- force_unwrapping
- identical_operands
- implicit_return
- joined_default_parameter
- last_where
- literal_expression_end_indentation
- modifier_order
- multiline_arguments
- multiline_parameters
- operator_usage_whitespace
- overridden_super_call
- pattern_matching_keywords
- prefer_self_type_over_type_of_self
- redundant_nil_coalescing
- redundant_type_annotation
- sorted_first_last
- sorted_imports
- static_operator
- strict_fileprivate
- toggle_bool
- trailing_closure
- unneeded_parentheses_in_closure_argument
- unused_import
- vertical_whitespace_closing_braces
- vertical_whitespace_opening_braces
- yoda_condition
line_length:
warning: 120
error: 160
ignores_comments: true
ignores_urls: true
type_body_length:
warning: 300
error: 400
file_length:
warning: 400
error: 600
ignore_comment_only_lines: true
function_body_length:
warning: 50
error: 80
cyclomatic_complexity:
warning: 12
error: 20
identifier_name:
min_length: 2
excluded:
- id
- x
- y
reporter: "xcode"
+14 -2
View File
@@ -5,6 +5,9 @@ import PackageDescription
let package = Package(
name: "TempestasDomain",
platforms: [
.macOS(.v14)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
@@ -12,15 +15,24 @@ let package = Package(
targets: ["TempestasDomain"]
),
],
dependencies: [
.package(url: "https://github.com/realm/SwiftLint", from: "0.65.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "TempestasDomain"
name: "TempestasDomain",
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
.testTarget(
name: "TempestasDomainTests",
dependencies: ["TempestasDomain"]
dependencies: ["TempestasDomain"],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
],
swiftLanguageModes: [.v6]
@@ -16,7 +16,8 @@ let package = Package(
),
],
dependencies: [
.package(path: "../TempestasDomain")
.package(path: "../TempestasDomain"),
.package(url: "https://github.com/realm/SwiftLint", from: "0.65.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
@@ -25,11 +26,17 @@ let package = Package(
name: "TempestasInfrastructure",
dependencies: [
"TempestasDomain"
],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
.testTarget(
name: "TempestasInfrastructureTests",
dependencies: ["TempestasInfrastructure"]
dependencies: ["TempestasInfrastructure"],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
],
swiftLanguageModes: [.v6]
+9 -2
View File
@@ -16,7 +16,8 @@ let package = Package(
),
],
dependencies: [
.package(path: "../TempestasDomain")
.package(path: "../TempestasDomain"),
.package(url: "https://github.com/realm/SwiftLint", from: "0.65.0"),
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
@@ -26,10 +27,16 @@ let package = Package(
dependencies: [
"TempestasDomain"
],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
.testTarget(
name: "TempestasPresentationTests",
dependencies: ["TempestasPresentation"]
dependencies: ["TempestasPresentation"],
plugins: [
.plugin(name: "SwiftLintBuildToolPlugin", package: "SwiftLint"),
]
),
],
swiftLanguageModes: [.v6]
+40 -13
View File
@@ -38,16 +38,22 @@
/* Begin PBXFileSystemSynchronizedRootGroup section */
F78655A9302222BC00869803 /* Tempestas */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
);
path = Tempestas;
sourceTree = "<group>";
};
F78655B9302222BD00869803 /* TempestasTests */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
);
path = TempestasTests;
sourceTree = "<group>";
};
F78655C3302222BD00869803 /* TempestasUITests */ = {
isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
);
path = TempestasUITests;
sourceTree = "<group>";
};
@@ -116,6 +122,7 @@
isa = PBXNativeTarget;
buildConfigurationList = F78655CA302222BD00869803 /* Build configuration list for PBXNativeTarget "Tempestas" */;
buildPhases = (
B6ABDCC5BB77C36E643FB43F /* SwiftLint */,
F78655A3302222BC00869803 /* Sources */,
F78655A4302222BC00869803 /* Frameworks */,
F78655A5302222BC00869803 /* Resources */,
@@ -154,8 +161,6 @@
F78655B9302222BD00869803 /* TempestasTests */,
);
name = TempestasTests;
packageProductDependencies = (
);
productName = TempestasTests;
productReference = F78655B6302222BD00869803 /* TempestasTests.xctest */;
productType = "com.apple.product-type.bundle.unit-test";
@@ -177,8 +182,6 @@
F78655C3302222BD00869803 /* TempestasUITests */,
);
name = TempestasUITests;
packageProductDependencies = (
);
productName = TempestasUITests;
productReference = F78655C0302222BD00869803 /* TempestasUITests.xctest */;
productType = "com.apple.product-type.bundle.ui-testing";
@@ -216,9 +219,9 @@
mainGroup = F786559E302222BC00869803;
minimizedProjectReferenceProxies = 1;
packageReferences = (
F78655D43022237700869803 /* XCLocalSwiftPackageReference "Packages/TempestasDomain" */,
F78655D53022240400869803 /* XCLocalSwiftPackageReference "Packages/TempestasInfrastructure" */,
F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "Packages/TempestasPresentation" */,
F78655D43022237700869803 /* XCLocalSwiftPackageReference "TempestasDomain" */,
F78655D53022240400869803 /* XCLocalSwiftPackageReference "TempestasInfrastructure" */,
F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "TempestasPresentation" */,
);
preferredProjectObjectVersion = 77;
productRefGroup = F78655A8302222BC00869803 /* Products */;
@@ -256,6 +259,28 @@
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
B6ABDCC5BB77C36E643FB43F /* SwiftLint */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
);
inputPaths = (
);
name = SwiftLint;
outputFileListPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export PATH=\"$PATH:/opt/homebrew/bin:/usr/local/bin\"\nif which swiftlint > /dev/null; then\n swiftlint lint --config \"${SRCROOT}/.swiftlint.yml\"\nelse\n echo \"warning: SwiftLint not installed. Run `brew install swiftlint`.\"\nfi\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
F78655A3302222BC00869803 /* Sources */ = {
isa = PBXSourcesBuildPhase;
@@ -433,6 +458,7 @@
ENABLE_RESOURCE_ACCESS_LOCATION = YES;
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
ENABLE_RESOURCE_ACCESS_USB = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
@@ -474,6 +500,7 @@
ENABLE_RESOURCE_ACCESS_LOCATION = YES;
ENABLE_RESOURCE_ACCESS_PRINTING = NO;
ENABLE_RESOURCE_ACCESS_USB = NO;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
ENABLE_USER_SELECTED_FILES = readonly;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_NSHumanReadableCopyright = "";
@@ -612,15 +639,15 @@
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
F78655D43022237700869803 /* XCLocalSwiftPackageReference "Packages/TempestasDomain" */ = {
F78655D43022237700869803 /* XCLocalSwiftPackageReference "TempestasDomain" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Packages/TempestasDomain;
};
F78655D53022240400869803 /* XCLocalSwiftPackageReference "Packages/TempestasInfrastructure" */ = {
F78655D53022240400869803 /* XCLocalSwiftPackageReference "TempestasInfrastructure" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Packages/TempestasInfrastructure;
};
F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "Packages/TempestasPresentation" */ = {
F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "TempestasPresentation" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = Packages/TempestasPresentation;
};
@@ -629,17 +656,17 @@
/* Begin XCSwiftPackageProductDependency section */
F7F82E2A3027462900921C76 /* TempestasDomain */ = {
isa = XCSwiftPackageProductDependency;
package = F78655D43022237700869803 /* XCLocalSwiftPackageReference "Packages/TempestasDomain" */;
package = F78655D43022237700869803 /* XCLocalSwiftPackageReference "TempestasDomain" */;
productName = TempestasDomain;
};
F7F82E2C3027462D00921C76 /* TempestasInfrastructure */ = {
isa = XCSwiftPackageProductDependency;
package = F78655D53022240400869803 /* XCLocalSwiftPackageReference "Packages/TempestasInfrastructure" */;
package = F78655D53022240400869803 /* XCLocalSwiftPackageReference "TempestasInfrastructure" */;
productName = TempestasInfrastructure;
};
F7F82E32302749BC00921C76 /* TempestasPresentation */ = {
isa = XCSwiftPackageProductDependency;
package = F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "Packages/TempestasPresentation" */;
package = F7F82E313027493A00921C76 /* XCLocalSwiftPackageReference "TempestasPresentation" */;
productName = TempestasPresentation;
};
/* End XCSwiftPackageProductDependency section */