Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad indentation defaults #19

Closed
puffnfresh opened this issue Nov 13, 2012 · 8 comments
Closed

Bad indentation defaults #19

puffnfresh opened this issue Nov 13, 2012 · 8 comments

Comments

@puffnfresh
Copy link

I was very surprised by the default indentation. I'm pretty confident that this is what most people would expect to see:

(setq scala-indent:indent-value-expression nil)
(setq scala-indent:align-parameters nil)
(setq scala-indent:align-forms nil)

The mode becomes awesome after those changes.

@hvesalai
Copy link
Owner

Thank's for the feedback. Awsome sounds good!

I've been discussing this with many developers and there seems to be two equally strong opposite camps. The way I see it is that I need to make the README.md very clear on this issue.

We need to hold a beauty contest once the mode has had enough testing that I feel confident in anouncing it to the world (altho the word has leeked already, I have learned).

Comments from other users on this issue are also welcomed here.

@non
Copy link
Contributor

non commented Nov 13, 2012

I agree with Brian's position (as you probably already knew). I think a beauty contest makes sense, although if a few more people weigh in on this side you may want to just flip the defaults (and warn current users).

Clearly those of us who know the mode is good can just configure it the way we want... it's just a question of what seems like better behavior to new users.

Sorry for spilling the beans, btw!

@ymasory
Copy link

ymasory commented Nov 15, 2012

I agree with:

(setq scala-indent:indent-value-expression nil)

since this is the idiomatic indentation:

def foo = if(true) {
  bar
}

not

def foo = if(true) {
    bar
  }

Having the latter as the default would invite re-formatting wars on teams where the devs are using different developers :)

This one I also agree with, but I'm not as confient that it's definitely "more idiomatic".

(setq scala-indent:align-parameters nil)

Can someone comment on what this one does?

(setq scala-indent:align-forms nil)

@puffnfresh
Copy link
Author

@ymasory align-forms non-nil:

val x = if (kala)
          foo
        else if (koira)
          bar
        else
          zot

align-forms nil:

val x = if (kala)
    foo
  else if (koira)
    bar
  else
    zot

@hvesalai
Copy link
Owner

align-forms nil, indent-value-expression nil is actually:

val x = if (kala)
  foo
else if (koira)
  bar
else
  zot

Which I personally find hard to read.

@non
Copy link
Contributor

non commented Nov 15, 2012

...but which is exactly what I want. 👍

@ymasory
Copy link

ymasory commented Nov 15, 2012

Thanks @hvesalai. I vote nil for all three then! The only items I tend to align between lines are the arrows in pattern matches.

Perhaps the scalariform defaults should be used? I believe ScalaIDE and ENSIME both use the Scalariform defaults without modification. Not sure about IntelliJ and othes.

@hvesalai
Copy link
Owner

Ok. Let it be so.

hvesalai added a commit that referenced this issue Nov 15, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants