-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
swiflint adding incorrect spaces #5663
Comments
Please provide a small code snippet you run SwiftLint on together with the changed code. Also mention the command you are running. |
I'm executing this command
original code: HStack{
Spacer()
Button(action: {
dismiss()
}, label: {
SwiftUI.Image(.deleteClose)
})
}.padding(.horizontal, -20) changed code: HStac k{
Spacer()
Button(action: {
dismiss()
}, label: {
SwiftUI.Image(.deleteClose)
})
}.padding(.horizontal, -20) original code: func getIcon() -> UIImage?{
switch self {
case .komootPlanned:
return UIImage(named: "komoot_empty")
case .komootRecorded:
return UIImage(named: "komoot_empty")
case .notifications:
return UIImage(named: "notifications_empty")
case .subscriptions:
return UIImage(named: "subscriptions_empty")
}
} changed code: func getIcon() -> UIImage ?{
switch self {
case .komootPlanned:
return UIImage(named: "komoot_empty")
case .komootRecorded:
return UIImage(named: "komoot_empty")
case .notifications:
return UIImage(named: "notifications_empty")
case .subscriptions:
return UIImage(named: "subscriptions_empty")
}
} |
I am also having the same issue |
I'm unable to reproduce this. My involved files and commands are as follows:
only_rules:
- opening_brace
func getIcon() -> UIImage?{
nil
} $ swiftlint --version
0.55.1 $ swiftlint lint --fix main.swift
Correcting Swift files at paths main.swift
Correcting 'main.swift' (1/1)
/Users/danny/Projects/SwiftLint/main/main.swift:1:27 Corrected Opening Brace Spacing
Done correcting 1 file!
func getIcon() -> UIImage? {
nil
} Please provide an example as small as possible which causes broken output with these steps. |
Give me a moment when I’m back in office and I’ll send over what causes it.
I ran it on my entire source folder I’m not sure if that’s how it works by
design but it added a weird white space to about 23 ish files mainly
SwiftUI based code
…On Sat, Jul 13, 2024 at 7:55 AM Danny Mösch ***@***.***> wrote:
I'm unable to reproduce this. My involved files and commands are as
follows:
.swiftlint.yml
only_rules:
- opening_brace
main.swift
func getIcon() -> UIImage?{
nil}
$ swiftlint --version
0.55.1
$ swiftlint lint --fix main.swift
Correcting Swift files at paths main.swift
Correcting 'main.swift' (1/1)
/Users/danny/Projects/SwiftLint/main/main.swift:1:27 Corrected Opening Brace Spacing
Done correcting 1 file!
main.swift
func getIcon() -> UIImage? {
nil}
Please provide an example as small as possible which causes broken output
with these steps.
—
Reply to this email directly, view it on GitHub
<#5663 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AJ3O33LXX67LM3RZGSC4POLZMEISXAVCNFSM6AAAAABKVMSZWOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRWHA3TIOJZG4>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Thanks, I'm doing the same, all source folder, I can send more info tomorrow, thanks for providing more info |
@gavinmcroy @pablorodriguezcolbaes - any update on this? |
swiflint adding incorrect spaces, i dont know if is a configuration issue or a bug in swiftlint, thanks for helping me
for example
func getIcon() -> UIImage ?{
func getIcon() -> UIImage? {
if hasToSav e{
if hasToSave {
HStac k{
HStack {
Environment
The text was updated successfully, but these errors were encountered: