You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
closure_spacing autocorrect reports correction but does not fix empty closure { } #6799
When an empty closure has more than one space between the braces (e.g., { }), running swiftlint --fix reports "Corrected closure_spacing 1 time" but the file content is unchanged. The violation persists on subsequent lint runs.
$ swiftlint lint --config .swiftlint.yml Example.swift
Example.swift:9:9: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace (closure_spacing)
$ swiftlint --fix --config .swiftlint.yml Example.swift
Example.swift: Corrected closure_spacing 1 time
$ swiftlint lint --config .swiftlint.yml Example.swift
Example.swift:9:9: warning: Closure Spacing Violation: Closure expressions should have a single space inside each brace (closure_spacing)
Expected: After --fix, { } should become { } (single space), and subsequent lint runs should report no violation.
Actual: The fixer claims success but the file is byte-identical before and after. The violation remains.
This appears to be specific to empty closures used as return values in computed properties.
Environment
SwiftLint version: 0.65.0 (also reproduced on 0.63.3)
Activity