Re: stripIndent() behavior

2018-04-11 Thread Éamonn McManus
OK, well I think we do agree that at least stripIndent should be changed to remove the longest exact whitespace prefix common to all lines? So if you give it one line starting with 8 spaces and another starting with a tab it will return the string unchanged. The current behaviour just counts whites

Re: stripIndent() behavior

2018-04-11 Thread Kirk Pepperdine
Hi, Mind if I bike shed on this one since everyone else it? A tab is white space of undefined length. Traditionally, tabs are the responsibility of the device (move forward software) to implement. This is why you *set* tabs. As such… it seems very reasonable that people don’t expect nor shoul

Re: stripIndent() behavior

2018-04-10 Thread Brian Goetz
I think this is "throwing" the baby out with the bathwater.  It is punishing those who can use tabs responsibly for the sins of those who cannot. You have to commit three sins before you have a problem:  - using tabs at all  - using tabs inconsistently across the lines of a single expression;  

Re: stripIndent() behavior

2018-04-10 Thread Brian Goetz
On 4/10/2018 5:18 PM, Kevin Bourrillion wrote: On Tue, Apr 10, 2018 at 1:50 PM, Brian Goetz > wrote: 3. If the input contains *any* tab characters at all (except any that are part of the trailing whitespace), then this method cannot know

Re: stripIndent() behavior

2018-04-10 Thread Kevin Bourrillion
On Tue, Apr 10, 2018 at 1:50 PM, Brian Goetz wrote: > > > 3. If the input contains *any* tab characters at all (except any that are >> part of the trailing whitespace), then this method cannot know that it >> isn't jumbling the end result, and maybe it should just throw. >> > I think there's a mid

Re: stripIndent() behavior

2018-04-10 Thread Brian Goetz
(now stripIndent) I've accumulated a few questions/comments on this. 1. When choosing the amount to trim, it ought to ignore blank lines and only-whitespace lines, right? Seems right. 2. Is it really appropriate to automatically remove trailing whitespace? I'm not sure about this either