On Wed, Apr 19, 2017 at 5:09 PM, Joe Groff <[email protected]> wrote: > > On Apr 19, 2017, at 3:07 PM, Xiaodi Wu <[email protected]> wrote: > > Hmm, I don't know that I agree. What's the harm of trailing spaces, and if > a warning, how would I silence it given that \ is rejected as a way to > suppress a literal newline? > > > \("") comes to mind, if nothing else. >
Good point. Other common tools like Git already flag trailing whitespace by default, so > even if Swift doesn't warn about it, you might still need to satisfy other > tools in your pipeline. > Isn't that an equally good argument for Swift *not* warning you about it? If it's harmful, you'll have other tools in the pipeline to flag it for you. > -Joe > > > On Wed, Apr 19, 2017 at 17:02 Joe Groff via swift-evolution < > [email protected]> wrote: > >> On Apr 19, 2017, at 2:43 PM, Adrian Zubarev <adrian.zubarev@devandartist. >> com> wrote: >> >> First of all, thank you for accepting the proposal. However I still have >> one single concern left about the trailing whitespaces. Will the final >> implemented version raise a warning or produce an error when there are >> trailing whitespaces? >> >> The whole idea of a trailing \ was in first place to prevent new line >> injection but also for trailing whitespace character precision. >> >> The following example could have 1000 characters, but a different >> developer who reads the code wouldn’t even notice. >> >> """ >> Foo<space><space>…<space> >> Bar >> """ >> >> That’s what the trailing backslash was meant for. To prevent unwanted >> whitespaces, or if you really need them, to force you to be precise about >> them. >> >> """ >> Foo<space><space><space>\n\ >> Bar >> """ >> >> That seems like a reasonable thing to warn about. That also reminds me, >> blank lines should be accepted within a literal even if they aren't >> "indented" with invisible whitespace. >> >> -Joe >> >> _______________________________________________ >> swift-evolution mailing list >> [email protected] >> https://lists.swift.org/mailman/listinfo/swift-evolution >> > >
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
