From 38c2e2bf9281c100b8d2c40215a2c06cfa8b400b Mon Sep 17 00:00:00 2001 From: Nikita Bobko Date: Fri, 17 Apr 2026 19:56:19 +0200 Subject: [PATCH] 1/2 swiftlint: don't use --fix & disable unused_optional_binding Motivation: 1. There is a swiftlint bug that doesn't show some diagnostics messages if --fix is used :( (e.g. unused_optional_binding, custom_rules) 2. Now, I can drop check_uncommitted_files in format.sh and tests.sh. We won't longer require clean git tree before tests could be run! Yay! I will do that in the next commit Disable unused_optional_binding, because I prefer `let _` over `!= nil` check in SequenceEx /Users/bobko/a/AeroSpace/Sources/Common/util/SequenceEx.swift:122:19: error: Unused Optional Binding Violation: Prefer `!= nil` over `let _ =` (unused_optional_binding) --- .swiftlint.yml | 1 - format.sh | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.swiftlint.yml b/.swiftlint.yml index d5d72769..6bcab726 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -41,7 +41,6 @@ only_rules: # - unused_closure_parameter - unused_control_flow_label - unused_enumerated # When the index or the item is not used, .enumerated() can be removed. - - unused_optional_binding # Prefer != nil over let _ = - unused_setter_value - weak_delegate # Delegates should be weak to avoid reference cycles diff --git a/format.sh b/format.sh index 0bcd7345..04acdbbc 100755 --- a/format.sh +++ b/format.sh @@ -18,4 +18,4 @@ if test $check_uncommitted_files -eq 1; then ./script/check-uncommitted-files.sh if test $check_uncommitted_files -eq 1; then ./script/check-uncommitted-files.sh; fi ./script/install-dep.sh --swiftlint -./.deps/swiftlint/swiftlint lint --quiet --fix +./.deps/swiftlint/swiftlint lint --quiet -- 2.51.2