How can we fix the "Trailing Whitespace Violation" warnings caused by swiftlint in my iOS project all in one go? I don't want to manually correct each one of them. Moreover, I don't want to disable these warnings so you can skip that suggestion.
I have been trying Find And Replace option but I am not getting a correct keyword to sort this out.
Image :
swiftlint has an autocorrect option that will fix some issues for you, so when I get trailing whitespace warnings I run swiftlint from the command line in my project
$ swiftlint autocorrect
Update
As of version 0.43 autocorrect
has been deprecated and replaced with --fix
so now the command is
$ swiftlint --fix
autocorrect
is still available for the time being, for more info see the change log