[swift-evolution] "bad smells" should be compiler errors with suggestions on how to fix them
brent at architechies.com
Sat Dec 5 15:10:14 CST 2015
>>> SwiftLint looks really nice, but one thing I'd really like is automatic formatting.
>> That's a feature of IDE, not the language itself.
> Not necessarily. The existence of "go fmt" has resulted in teams running it as a pre-commit translation and as a way of standardising across all users, regardless of IDEs. Otherwise you end up with multiple IDEs (like Eclipse and IntelliJ) which do formatting slightly differently and lead to all manner of pointless arguments.
> Letting "the IDE" do formatting is fine provided there is a maximum of one IDE.
This is perhaps out of scope for this group, but I’ve actually long wanted languages to move in a direction where indentation is not present at all in the source file—your git repo might never have an instance of /\n[ \t]/ in it. Instead, it’s automatically added by the IDE while displaying the code, based on the block beginnings and endings present in the actual source. This would make incorrectly indented code a thing of the past; it would also be obvious when you’re missing a curly bracket, because your code would be indented all wrong. And it would end the destructive whitespace wars, because everyone could just set their IDE to do whatever they liked best.
More information about the swift-evolution