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 not idempotent: keeps adding newlines below block comment #9483

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

Comments

Projects
None yet
1 participant
@timotheecour
Copy link
Collaborator

timotheecour commented Oct 24, 2018

/cc @Araq
the latest commits are great... but (IIRC) introduced this regression:

nipretty applied twice on main.nim should be always same as nimpretty applied once

Example

#[
foo bar
]#

proc fun() =
  echo "ok1"

Current Output

#[
foo bar
]#




proc fun() =
  echo "ok1"

Expected Output

#[
foo bar
]#

proc fun() =
  echo "ok1"
  • Furthermore, when we call nimpretty again on resulting file, it keeps adding newlines

a test could be added in testsuite that for each sample, nimpretty(nimpretty(x)) == nimpretty(x)

@timotheecour timotheecour changed the title [regression] nimpretty adds too many newlines below block doc comment nimpretty adds too many newlines below block doc comment Oct 24, 2018

@timotheecour timotheecour changed the title nimpretty adds too many newlines below block doc comment nimpretty adds too many newlines below block comment Oct 24, 2018

@timotheecour timotheecour changed the title nimpretty adds too many newlines below block comment nimpretty not idempotent: keeps adding newlines below block comment Oct 24, 2018

@Araq Araq closed this in 06a6433 Oct 24, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment