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

Blue style: multiline `using` statements formatted incorrectly

Open cmichelenstrofer opened this issue 2 years ago • 3 comments

using Unitful: Dimension, DimensionlessQuantity, Frequency, FrequencyFreeUnits, MixedUnits,
    NoDims, NoUnits, Number, Quantity, Time, Unitlike, Unit, Units

gets formatted to

using Unitful:
    Dimension,
    DimensionlessQuantity,
    Frequency,
    FrequencyFreeUnits,
    MixedUnits,
    NoDims,
    NoUnits,
    Number,
    Quantity,
    Time,
    Unitlike,
    Unit,
    Units

This is exactly what the Blue Style says not to do.

cmichelenstrofer avatar Dec 04 '22 21:12 cmichelenstrofer

cc @nickrobinson251

domluna avatar Dec 08 '22 01:12 domluna

yeah... i guess the formatter shouldn't change this case. Or, if the using Unitful: Dimension, DimensionlessQuantity, ... goes over the line limit just break and continue indented on the next line using Unitful: Dimension, DimensionlessQuantity, ...,\n\tMixedUnits, ...

nickrobinson251 avatar Dec 13 '22 14:12 nickrobinson251

In this specific case the comma at the end of the first line is the 91st character. There is still space for another character. I believe the original example should not be affected by the formatter.

cmichelenstrofer avatar Dec 13 '22 16:12 cmichelenstrofer