fredrikekre / Runic.jl

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

Runic adds double line spacing #18

Closed KnutAM closed 1 month ago

KnutAM commented 1 month ago

Nice package!

I'm quite happy with the suggestions from Runic.jl here (especially if #12 would be included).

But for some reason double line spacing is added in docs/make.jl

E.g.

using FerriteMeshParser
using Documenter

+
const is_ci = get(ENV, "CI", "false") == "true"

Simply ran julia -e 'using Pkg; Pkg.activate(;temp=true); Pkg.add(url = "https://github.com/fredrikekre/Runic.jl"); using Runic; exit(Runic.main(ARGS))' -- -i .

(I tried changed all line endings from CRLF to LF, but cannot rule out that this could be an issue still somehow)

fredrikekre commented 1 month ago

Xref https://github.com/JuliaGeometry/DelaunayTriangulation.jl/pull/138#discussion_r1676791621

Probably fixed by https://github.com/JuliaLang/JuliaSyntax.jl/pull/460 and most likely Windows related

KnutAM commented 1 month ago

(I tried changed all line endings from CRLF to LF, but cannot rule out that this could be an issue still somehow

Apparently, this must have been the issue. Can reproduce the behavior only when making sure that docs/make.jl has CRLF line endings, with LF line endings, it works as intended.

I could not test with the proposed fixed, since I couldn't figure out the version compatibility with julia syntax since JuliaSyntax#main is v0.4.6 but Runic.jl requires the released v0.4.8.

Here are minimum reproducers with lf and crlf in case helpful: testfiles.zip

fredrikekre commented 1 month ago

Try again with JuliaSyntax@0.4.9 and Runic master? Probably have to reset the commit first because Runic will not revert the double lines once they are in the source.

KnutAM commented 1 month ago

Can confirm that it works, ref https://github.com/Ferrite-FEM/FerriteMeshParser.jl/pull/51/files