fredrikekre/Runic.jl

Allow multiple trailing zeros in floating point literals

Opened this issue · 2 comments

Currently multiple trailing zeros are removed. These are sometimes used for alignment in e.g. literal arrays. Currently

 [
-    0.100 0.123
-    0.123 0.100
+    0.1 0.123
+    0.123 0.1
 ]

Perhaps this should be allowed, or atleast be disabled inside array literals?

With JuliaFormatter, I have had to do:

      #! format: off
      arr[:, :] .= [
      #  foobarbaz   baz    qux  
         34.36       5.89   20.28   # class_a
          0.29       0.00    0.00   # class_b
      ]
      #! format: on

Specifically, here we wanted to align the data along with the comment names.

Maybe just having a way to turn off formatting for a section would be a good feature to have?

I think it should be sufficient to right justify columns and allow trailing zeros to pad with.