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

nimpretty shouldn't format differently whether there's a top-level newline #9484

Closed
timotheecour opened this Issue Oct 24, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@timotheecour
Copy link
Collaborator

timotheecour commented Oct 24, 2018

Example

fun1.nim

#[
foo bar
]#



proc fun() =
  echo "ok1"

fun2.nim : same but with added newline at top (maybe not visible in github but there's a empty newline before first #[)

#[
foo bar
]#



proc fun() =
  echo "ok1"

Current Output

  • fun1.nim is unchanged BUG: should reformat since too many newlines
  • fun2.nim is formatted differenty from fun1.nim BUG: nimpretty shouldn't care

@Araq Araq closed this in e7e7522 Oct 24, 2018

@Araq

This comment has been minimized.

Copy link
Member

Araq commented Oct 24, 2018

fun1.nim is unchanged BUG: should reformat since too many newlines

There is no such thing as too many newlines.

fun2.nim is formatted differenty from fun1.nim BUG: nimpretty shouldn't care

No, it should care, nimpretty is opinionated software that keeps your newlines.

@timotheecour

This comment has been minimized.

Copy link
Collaborator

timotheecour commented Oct 25, 2018

I guess you meant un-opiniated instead of opiniated here; ok makes sense (in prior versions of nimpretty, it was more opiniated about newlines and was changing number of newlines); the new behavior (leave as is) is at least more consistent / predictable

narimiran added a commit to narimiran/Nim that referenced this issue Oct 31, 2018

narimiran added a commit to narimiran/Nim that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

narimiran added a commit that referenced this issue Nov 1, 2018

nimpretty: closes #9484
(cherry picked from commit e7e7522)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment