From 16a88b55a658215152d3fe77b586a7890f494c75 Mon Sep 17 00:00:00 2001 From: Toomas Vahter Date: Tue, 7 Oct 2025 16:32:25 +0300 Subject: [PATCH 1/4] Remove trailing_whitespace from SwiftLint rules due to multi-line string issues --- .swiftlint.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index 9cc8b04..2ff656d 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -50,7 +50,6 @@ only_rules: - trailing_comma - trailing_newline - trailing_semicolon - - trailing_whitespace - unneeded_break_in_switch - unneeded_override - unused_closure_parameter @@ -62,9 +61,6 @@ only_rules: multiline_arguments: only_enforce_after_first_closure_on_first_line: true -trailing_whitespace: - ignores_empty_lines: true - file_name_no_space: severity: error From a44aec6aba14fae4caa16a70b52be16b635ddb9c Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Tue, 7 Oct 2025 17:16:00 +0100 Subject: [PATCH 2/4] Lint everything --- fastlane/Fastfile | 11 ++++------- lefthook.yml | 4 ---- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/fastlane/Fastfile b/fastlane/Fastfile index fe075f8..3bba9a9 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -195,11 +195,9 @@ desc 'Run source code formatting/linting' lane :run_swift_format do |options| Dir.chdir('..') do strict = options[:strict] ? '--lint' : nil - sources_matrix[:swiftformat].each do |path| - sh("swiftformat #{strict} --config .swiftformat #{path}") - sh("swiftlint lint --config .swiftlint.yml --fix --progress --reporter json #{path}") unless strict - sh("swiftlint lint --config .swiftlint.yml --strict --progress --reporter json #{path}") - end + sh("swiftformat #{strict} --config .swiftformat .") + sh("swiftlint lint --config .swiftlint.yml --fix --progress --reporter json") unless strict + sh("swiftlint lint --config .swiftlint.yml --strict --progress --reporter json") end end @@ -213,8 +211,7 @@ lane :sources_matrix do sample_apps: ['Sources', 'DemoApp', xcode_project], ruby: ['fastlane', 'Gemfile', 'Gemfile.lock'], size: ['Sources', xcode_project], - public_interface: ['Sources'], - swiftformat: ['Sources', 'DemoApp', 'Tests', 'Package.swift'] + public_interface: ['Sources'] } end diff --git a/lefthook.yml b/lefthook.yml index 13e7a3f..61221d9 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -4,8 +4,6 @@ pre-commit: - run: swiftlint lint --config .swiftlint.yml --fix --progress --reporter json {staged_files} glob: "*.{swift}" stage_fixed: true - exclude: - - "**/generated/**" skip: - merge - rebase @@ -21,7 +19,5 @@ pre-push: jobs: - run: swiftlint lint --config .swiftlint.yml --strict --progress --reporter json {push_files} glob: "*.{swift}" - exclude: - - "**/generated/**" skip: - merge-commit From e371d27929595cace2a346f29a66eefc194eb1ca Mon Sep 17 00:00:00 2001 From: Alexey Alter-Pesotskiy Date: Tue, 7 Oct 2025 17:39:29 +0100 Subject: [PATCH 3/4] Update ignore cases --- .swiftformat | 3 +++ .swiftlint.yml | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.swiftformat b/.swiftformat index dba0a83..fb380e1 100644 --- a/.swiftformat +++ b/.swiftformat @@ -78,3 +78,6 @@ --wraparguments before-first --wrapparameters before-first --wrapcollections before-first + +# Exclude paths +--exclude Sources/StreamFeeds/Generated,Sources/StreamFeeds/generated,vendor/bundle,Pods,spm_cache,derived_data,.build diff --git a/.swiftlint.yml b/.swiftlint.yml index 2ff656d..76f3b5e 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -4,13 +4,9 @@ excluded: - .ruby-lsp - .swiftpm - derived_data - - fastlane - - Package.swift - - Scripts - Sources/StreamFeeds/Generated - Sources/StreamFeeds/generated - spm_cache - - vendor - vendor/bundle only_rules: From 07e02852c0d29e04acd3fa3c67ad3db9dc9057ba Mon Sep 17 00:00:00 2001 From: Toomas Vahter Date: Wed, 8 Oct 2025 11:55:25 +0300 Subject: [PATCH 4/4] Rename deprecated rule --- .swiftformat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.swiftformat b/.swiftformat index fb380e1..5a46ff3 100644 --- a/.swiftformat +++ b/.swiftformat @@ -34,7 +34,7 @@ --rules redundantRawValues --rules redundantVoidReturnType --rules semicolons ---rules sortedImports +--rules sortImports --rules spaceAroundBraces --rules spaceAroundBrackets --rules spaceAroundComments