fredrikekre / Runic.jl

A code formatter for Julia with rules set in stone.
MIT License
98 stars 3 forks source link

Runic indents docstrings strangely #27

Closed Klafyvel closed 2 months ago

Klafyvel commented 3 months ago

Hi, I noticed this strange behavior of Runic.jl when indenting a docstring:

➜  tmp cat test.jl
module A
module B
"""
My documentation
"""
function foo end
end
end
➜  tmp runic -c --diff test.jl
Checking `test.jl` ........................................................... ✖
diff --git a/test.jl b/test.jl
index abd6851..07c7dd5 100644
--- a/test.jl
+++ b/test.jl
@@ -1,8 +1,8 @@
 module A
 module B
-"""
+    """
 My documentation
 """
-function foo end
+    function foo end
 end
 end
fredrikekre commented 3 months ago

Thanks for the report. This has been a potential bug in the back of my mind for a time.

I suspect this isnt specific to docstrings but to all multiline strings.