Open dankinsoid opened 1 month ago
What was the bug?
@nicklockwood it was my fault, incorrect protocol implementation, I was in a hurry to create an issue. However, I also had a problem: swiftformat replaced writer.forEach
with for item in writer
, but writer was not a Collection
, it just had a forEach
method. I know that I can avoid such problems with //swiftformat:disable
, but I would like to have some default safe rules preset to ensure that nothing in my project can be broken by the formatter, especially when using swiftformat for the first time on a large project.
@dankinsoid understood. The safest option for now is to use --disable all
and then manually enable just the rules that you would like.
But I think the safe ruleset option is a good idea and I will investigate adding that.
I've spent the whole day debugging a bug and finally figured out that my app delegate function signatures look like this:
because of the
unusedArguments
rule that is enabled by default.There are some absolutely harmless formatting rules like indentation and many rules that can affect code functionality like
unusedArguments
. I believe that by default, only harmless rules should be enabled. Or, at least, some default rule presets should exist, so I could choose asafe
preset as a base and then configure it in my.swiftformat
file.