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

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

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

Comments

@timotheecour
Copy link
Member

@timotheecour 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
Copy link
Member

@Araq 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
Copy link
Member Author

@timotheecour 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
(cherry picked from commit e7e7522)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants