From 0e219ac7a7e1eae64e7ca5b96355a12e05d3dc25 Mon Sep 17 00:00:00 2001 From: lucasdeprit Date: Fri, 2 May 2025 12:27:41 +0200 Subject: [PATCH 1/2] fixes for ci workflow linter --- .github/workflows/ci.yml | 11 +- .swiftlint.yml | 26 +++ swiftlint_report.json | 443 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 478 insertions(+), 2 deletions(-) create mode 100644 .swiftlint.yml create mode 100644 swiftlint_report.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8e09f2..44ef127 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,15 @@ jobs: - name: Install SwiftLint run: brew install swiftlint - - name: Run SwiftLint with GitHub reporter - run: swiftlint lint --reporter github + - name: Run SwiftLint and save warnings/errors + run: | + swiftlint lint --config .swiftlint.yml --reporter json > swiftlint_report.json || true + + - name: Upload SwiftLint report + uses: actions/upload-artifact@v3 + with: + name: swiftlint-report + path: swiftlint_report.json release: if: startsWith(github.ref, 'refs/tags/v') diff --git a/.swiftlint.yml b/.swiftlint.yml new file mode 100644 index 0000000..137a2c8 --- /dev/null +++ b/.swiftlint.yml @@ -0,0 +1,26 @@ +opt_in_rules: + - empty_count + - line_length + - nesting + - trailing_whitespace + +disabled_rules: + - force_cast + - force_try + - legacy_constructor + - todo + - void_return + +line_length: + warning: 120 + error: 200 + +trailing_whitespace: + warning: true + +empty_count: + warning: true + +nesting: + warning: true + diff --git a/swiftlint_report.json b/swiftlint_report.json new file mode 100644 index 0000000..fb97bbf --- /dev/null +++ b/swiftlint_report.json @@ -0,0 +1,443 @@ +[ + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/FactoryWrapper.swift", + "line" : 15, + "reason" : "Line should be 120 characters or less; currently it has 121 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/FactoryWrapper.swift", + "line" : 20, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/FactoryWrapper.swift", + "line" : 23, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/FactoryWrapper.swift", + "line" : 26, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : 12, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/Injector.swift", + "line" : 49, + "reason" : "Variable name 'AppContainer' should start with a lowercase character", + "rule_id" : "identifier_name", + "severity" : "Error", + "type" : "Identifier Name" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/Injector.swift", + "line" : 22, + "reason" : "Line should be 120 characters or less; currently it has 121 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/Injector.swift", + "line" : 18, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : 35, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Package.swift", + "line" : 12, + "reason" : "Collection literals should not have trailing commas", + "rule_id" : "trailing_comma", + "severity" : "Warning", + "type" : "Trailing Comma" + }, + { + "character" : 40, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Package.swift", + "line" : 21, + "reason" : "Collection literals should not have trailing commas", + "rule_id" : "trailing_comma", + "severity" : "Warning", + "type" : "Trailing Comma" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 19, + "reason" : "Line should be 120 characters or less; currently it has 123 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 20, + "reason" : "Line should be 120 characters or less; currently it has 133 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 27, + "reason" : "Line should be 120 characters or less; currently it has 121 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 9, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 12, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Sources/Injector/DependencyContainer.swift", + "line" : 50, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 41, + "reason" : "Line should be 120 characters or less; currently it has 122 characters", + "rule_id" : "line_length", + "severity" : "Warning", + "type" : "Line Length" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 5, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 8, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 13, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 18, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 24, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 28, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 31, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 35, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/InjectorTests.swift", + "line" : 39, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 5, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 8, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 13, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 18, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 21, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/FactoryWrapperTests.swift", + "line" : 26, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 79, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 100, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 102, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 117, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 120, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : 3, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 122, + "reason" : "Prefer at least one space after slashes for comments", + "rule_id" : "comment_spacing", + "severity" : "Warning", + "type" : "Comment Spacing" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 5, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 7, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 12, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 23, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 26, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 31, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 37, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 40, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 51, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 55, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 58, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + }, + { + "character" : null, + "file" : "/Users/frameluak/Development/swift/my-packages/Injector/Tests/InjectorTests/DependencyContainerTests.swift", + "line" : 62, + "reason" : "Lines should not have trailing whitespace", + "rule_id" : "trailing_whitespace", + "severity" : "Warning", + "type" : "Trailing Whitespace" + } +] From 41e4ef39b6f18ed0f4a2490e2d47de5a6ecd279c Mon Sep 17 00:00:00 2001 From: Lucas Deprit <33033880+lucasdeprit@users.noreply.github.com> Date: Fri, 2 May 2025 12:32:34 +0200 Subject: [PATCH 2/2] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44ef127..97a9a46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: swiftlint lint --config .swiftlint.yml --reporter json > swiftlint_report.json || true - name: Upload SwiftLint report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: swiftlint-report path: swiftlint_report.json