Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redundant Optional Initialization in multi-var declaration results in transposed space and ',' char #4794

Closed
rlpm opened this issue Mar 3, 2023 · 0 comments · Fixed by #4795
Assignees
Labels

Comments

@rlpm
Copy link

rlpm commented Mar 3, 2023

I encountered the following while linting a much larger file. But I boiled it down to a single line. SwiftLint transposes the space and ',' characters after fixing a Redundant Optional Initialization:

% cat > foo.swift <<< "var a: Int? = nil, b: Int"
% cat foo.swift
var a: Int? = nil, b: Int
% swiftlint --fix foo.swift                      
Correcting Swift files at paths foo.swift
Correcting 'foo.swift' (1/1)
/tmp/foo.swift:1:12 Corrected Redundant Optional Initialization
Done correcting 1 file!
% cat foo.swift            
var a: Int? ,b: Int
% swiftlint --fix foo.swift
Correcting Swift files at paths foo.swift
Correcting 'foo.swift' (1/1)
/tmp/foo.swift:1:12 Corrected Comma Spacing
Done correcting 1 file!
% cat foo.swift            
var a: Int?, b: Int
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants