JuliaFormatter.jl icon indicating copy to clipboard operation
JuliaFormatter.jl copied to clipboard

Comments should not be moved across parentheses

Open LilithHafner opened this issue 4 months ago • 0 comments

Code like

combine(x, 3 #= this is the magic number =#) 

should probably not be reformatted to

combine(x, 3) #= this is the magic number =#

because the comment may refer to the function argument specifically.

In general, comments should typically not be moved as much because they are more likely to be intentionally placed with readability and formatting in mind.

Originally reported by @oscardssmith in https://github.com/SciML/DiffEqBase.jl/pull/1008#discussion_r1491504423

LilithHafner avatar Feb 15 '24 21:02 LilithHafner