Any way to get SBT whitespace agnostic?

63 views
Skip to first unread message

kraythe

unread,
Feb 14, 2014, 12:11:25 AM2/14/14
to scala...@googlegroups.com
I have to say I have one annoyance with SBT that sort of grates on me. I hate that it has to be double spaced. I haven't double spaced things since typing on an old Xerox typewriter in junior high school. Why is it that it has to be double spaced and is there any way it can be changed to overcome this issue? 

Som Snytt

unread,
Feb 14, 2014, 12:43:05 AM2/14/14
to kraythe, scala-user
The REPL collects lines until the text parses.



On Thu, Feb 13, 2014 at 9:11 PM, kraythe <kra...@gmail.com> wrote:
I have to say I have one annoyance with SBT that sort of grates on me. I hate that it has to be double spaced. I haven't double spaced things since typing on an old Xerox typewriter in junior high school. Why is it that it has to be double spaced and is there any way it can be changed to overcome this issue? 

--
You received this message because you are subscribed to the Google Groups "scala-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-user+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Naftoli Gugenheim

unread,
Feb 14, 2014, 2:47:34 AM2/14/14
to kraythe, scala-user
The reason is this:

The lines in a .sbt file are not statements, they are expressions that evaluate to a Setting or Seq[Setting]. In order to avoid recompiling the whole sbt file when you change it and reload, SBT caches each setting, and scans the .sbt files for changes. This way it can just recompile the individual lines that changed.

Come to think of it, you can probably get around it by making your whole file one Seq:

Seq(
  libraryDependencies += ... ,
  libraryDependencies ++= Seq(...),
  initialCommands in console := ""
)

I haven't tried it though. Also, then you *can't* have blank lines, because sbt will parse each part separately. You could probably have lines that just contain // though.



On Fri, Feb 14, 2014 at 12:11 AM, kraythe <kra...@gmail.com> wrote:
I have to say I have one annoyance with SBT that sort of grates on me. I hate that it has to be double spaced. I haven't double spaced things since typing on an old Xerox typewriter in junior high school. Why is it that it has to be double spaced and is there any way it can be changed to overcome this issue? 

--

Naftoli Gugenheim

unread,
Feb 14, 2014, 3:07:26 AM2/14/14
to kraythe, scala-user
Also, if you don't like it, why not use project/*.scala build files?

P.S. Whether the added speed is worth the difference in syntax, you can debate on sbt-dev. Although personally I don't mind it at all. Maybe I even prefer it this way.

Jason Zaugg

unread,
Feb 14, 2014, 5:21:36 AM2/14/14
to kraythe, scala-user
On Fri, Feb 14, 2014 at 6:11 AM, kraythe <kra...@gmail.com> wrote:
I have to say I have one annoyance with SBT that sort of grates on me. I hate that it has to be double spaced. I haven't double spaced things since typing on an old Xerox typewriter in junior high school. Why is it that it has to be double spaced and is there any way it can be changed to overcome this issue? 

The decision originally came from the constraint that build.sbt should be machine editable. In an SBT session, you can run `set foo := bar`, and that will be persisted into the file.

In practise, people don't tend to use this feature that much, and we might revisit this decision in the post-0.13 release of SBT.

There is an sbt-dev mailing list on google groups that might be a good place to discuss this.

-jason

Seth Tisue

unread,
Feb 14, 2014, 8:35:35 AM2/14/14
to scala...@googlegroups.com, kraythe
I was surprised that my Googling didn't turn up a canonical answer to this sbt FAQ, so I just wrote this:


Edits welcome.

Josh Suereth

unread,
Feb 14, 2014, 9:29:43 AM2/14/14
to Seth Tisue, scala-user, kraythe


Reply all
Reply to author
Forward
0 new messages