let letters: [String] = ["h", "e", "l", "l", "o"]
letters.forEach { letter in
print(letter)
}
After I run swiftformat script, it updates the code into this
let letters: [String] = ["h", "e", "l", "l", "o"]
for letter in letters {
print(letter)
}
Even though onelineforeach is set to ignore, the format option is not ignored.
Despite this, its default state is set to convert and not to ignore as it was stated in documentation.
So, even without explicitly setting onelineforeach to ignore, it still converts the code
My .swiftformat file contains this
This is the original code
After I run swiftformat script, it updates the code into this
Even though onelineforeach is set to ignore, the format option is not ignored. Despite this, its default state is set to convert and not to ignore as it was stated in documentation. So, even without explicitly setting onelineforeach to ignore, it still converts the code