You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was casually trying out Nim-lang and playing with nimpretty. Ofcourse I decided to mess with a flag called "indent", and nimpretty doesn't seem to handle this.
I don't really have the time to do a full bisect, I just installed it and played around. Felt it was better to report this than to ignore it.
Example run
~ :: nim r a.nim
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: used config file '/etc/nim/config.nims' [Conf]
Hint: gc: refc; opt: none (DEBUG BUILD, `-d:release` generates faster code)
9905 lines; 0.010s; 8.645MiB peakmem; proj: /home/ed/a.nim; out: /home/ed/.cache/nim/a_d/a_5220365807561D8E69F6B4EBF89A3C6B14B8A8F3 [SuccessX]
Hint: /home/ed/.cache/nim/a_d/a_5220365807561D8E69F6B4EBF89A3C6B14B8A8F3 [Exec]
~ :: nimpretty a.nim --indent:10
~ :: nim r a.nim
Hint: used config file '/etc/nim/nim.cfg' [Conf]
Hint: used config file '/etc/nim/config.nims' [Conf]
.........................................................
/home/ed/a.nim(5, 5) Error: invalid indentation
Example
a.nim before
procx() =let
x =iftrue: 1else: 0
error ="abc"echo x
a.nim after nimpretty --indent:3
procx() =let
x =iftrue: 1else: 0
error ="abc"echo x
This happens for indent:3 and indent:10. I haven't tested more, I suspect there are some assumptions in the formatter.
Expected Output
procx() =let
x =iftrue: 1else: 0
error ="abc"echo x
Possible Solution
Remove the --indent flag, it looks like you
Fix the implicit assumption in the formatter for 2 spaces as indentation
Additional Information
nim version
Nim Compiler Version 1.6.6 [Linux: amd64]
Compiled at 2022-05-22
Copyright (c) 2006-2021 by Andreas Rumpf
active boot switches: -d:release
nimpretty version
0.2
Disclaimer
Haven't tested with head - nimpretty doesn't seem to have been touched in some time so I saved myself some time there. <3
The text was updated successfully, but these errors were encountered:
I was casually trying out Nim-lang and playing with
nimpretty
. Ofcourse I decided to mess with a flag called "indent", and nimpretty doesn't seem to handle this.I don't really have the time to do a full bisect, I just installed it and played around. Felt it was better to report this than to ignore it.
Example run
Example
a.nim before
a.nim after
nimpretty --indent:3
This happens for
indent:3
andindent:10
. I haven't tested more, I suspect there are some assumptions in the formatter.Expected Output
Possible Solution
--indent
flag, it looks like you2
spaces as indentationAdditional Information
nim version
nimpretty version
Disclaimer
Haven't tested with head - nimpretty doesn't seem to have been touched in some time so I saved myself some time there. <3
The text was updated successfully, but these errors were encountered: