nicklockwood / SwiftFormat

A command-line tool and Xcode Extension for formatting Swift code
MIT License
7.9k stars 640 forks source link

--typeAttributes seems to be ignored for class #960

Closed ts0l closed 3 years ago

ts0l commented 3 years ago

when I run swiftformat using --typeattributes prev-line on a class, it doesn't do anything on this code example: @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { however, running --funcattributes prev-line does modify the code and places the attribute tag on the previous line

I am on 0.48.5

nicklockwood commented 3 years ago

@ts0l this is working correctly for me. Is it possible that you've got an extra .swiftformat file somewhere in your project path with different configuration? Check the output in the console when you run swiftformat.

nicklockwood commented 3 years ago

@ts0l it's also possible the problem depends on some other code in the same file. Are you able to reproduce it with a standalone code sample?

ts0l commented 3 years ago

hmm, reproducing the issue with my same format seems not to work. i'll close this and re-open if I see it again :) thanks!