Skip to content

Switch to JuliaFormatter V2#1032

Draft
arlowhite wants to merge 2 commits into
mainfrom
fix/formatter
Draft

Switch to JuliaFormatter V2#1032
arlowhite wants to merge 2 commits into
mainfrom
fix/formatter

Conversation

@arlowhite
Copy link
Copy Markdown
Contributor

@arlowhite arlowhite commented Jan 29, 2026

see issue #1029

  • Formatted all files with JuliaFormatter 2.2.0
  • changed GitHub Format.yml to use JuliaFormatter V2

I'm not sure what changed recently, JuliaFormatter 2 was released Oct 2024
https://github.com/domluna/JuliaFormatter.jl/releases/tag/v2.0.0

format(".")
returned false first time, ran 2nd, then returned true

@arlowhite arlowhite marked this pull request as draft January 29, 2026 23:12
@arlowhite arlowhite changed the title Fix Julia code formatting Switch to JuliaFormatter V2 Feb 3, 2026
@arlowhite
Copy link
Copy Markdown
Contributor Author

Copy link
Copy Markdown
Contributor Author

@arlowhite arlowhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

highlighting interesting changes

Comment thread ext/AvizExt/AvizExt.jl
import GeoMakie.GeoJSON.FeatureCollection as FC

import ADRIA.FileIO, ADRIA.GFT
using ADRIA.FileIO: FileIO
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you like this style better? there may be a formatting option, haven't checked

Comment thread ext/AvizExt/AvizExt.jl

sel_asv_scens = dropdims(
mean(asv_scens(; timesteps=timespan)[scenarios=show_idx]; dims=:timesteps);
mean(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

different line breaks

varying_cols = [
i for (i, col) in enumerate(eachcol(scens))
if !all(==(first(col)), col)
if !all(==(first(col)), col)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed indent, is this more correct or would you want the indent here?

factors=At(target_factors)
]
factors = At(target_factors)
]
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v2 formatting fix

# Alias default constructor
FogPreferences(names, criteria, directions) =
DecisionPreferences(names, criteria, directions)
FogPreferences(names, criteria, directions) = DecisionPreferences(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better or worse? this one feels more like personal preference

[filter(x -> occursin(yr, x), joinpath.(file_path, conn_fns)) for yr in years]
)
[filter(x -> occursin(yr, x), joinpath.(file_path, conn_fns)) for yr in years]
)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another v2 indent fix

# reduction is to capped to 0.
@. capped_dhw =
min.(ℯ^(0.17 + 0.35 * max(0.0, dhw' - (a_adapt + (tstep * n_adapt)))) - 1.0, 100.0)
@. capped_dhw = min.(
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar to above, no newline after =

Comment thread test/metrics/spatial.jl
@test all(
diff[summary=At(:lower_bound)] .<= diff[summary=At(:agg_value)] .<=
diff[summary=At(:upper_bound)]
diff[summary = At(:lower_bound)] .<=
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems nicer to me

Comment thread test/viz/spatial.jl

viz.map(
TEST_RS, guided_diff[summary=At(:agg_value)]; diverging=true, fig_opts=fig_opts
TEST_RS, guided_diff[summary = At(:agg_value)]; diverging=true,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the spacing around = just made line too long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant