-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
[WONTFIX] nimpretty infers wrong indentation #9512
Comments
It doesn't infer it at all, that's why. ;-) |
it does: diff --git a/compiler/layouter.nim b/compiler/layouter.nim
index 9f9b6fc8e..fe6125d7e 100644
--- a/compiler/layouter.nim
+++ b/compiler/layouter.nim
@@ -43,6 +43,7 @@ proc openEmitter*(em: var Emitter, cache: IdentCache;
let fullPath = Absolutefile config.toFullPath(fileIdx)
em.indWidth = getIndentWidth(fileIdx, llStreamOpen(fullPath, fmRead),
cache, config)
+ echo ("em.indWidth:", em.indWidth)
if em.indWidth == 0: em.indWidth = 2
em.config = config
em.fid = fileIdx produces this output: (Field0: "em.indWidth:", Field1: 4) a not-very-robust way to infer in this example is to take the 1st argument reflow (line 2: 4 spaces) and divide by 2; however that's only ok if it was obtained by a previous invocation of nimpretty; |
It infers the indentation, not the "margin". |
duh... was a typo; i meant indentation; the bug still holds despite my typo :) |
Why close this? It seems like a genuine bug |
@dom96 because of this comment from @narimiran #10629 (comment)
I went through all my open issues and they're all valid (IMO), but I had to reduce to < 150 to avoid this stalemate. |
@timotheecour Please show some respect. You are supposed to reduce your issues to set priorities on them. They are not all valid. I am sure I can find some that are invalid or written in a very obscure way that I have no idea what the real problem is. But the point is, you should do it and don't continue to waste our time on it. Only keep the important and issues open and close the issues that are not important. Then it would be really nice of you, when from the other 144 issues if you would check if they conform the issues template and rework them to make them easier processable. You still have 144 issues from 1256 issues in total. That is more that 10% from you alone. |
nimpretty indents as:
(ie, it wrongly inferred indentation of 4, whereas it was 2)
EDIT: s/margin/indentation/ (was a typo)
The text was updated successfully, but these errors were encountered: