Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make #729 optional #730

Closed
efaulhaber opened this issue Jun 4, 2023 · 1 comment · Fixed by #732
Closed

Make #729 optional #730

efaulhaber opened this issue Jun 4, 2023 · 1 comment · Fixed by #732

Comments

@efaulhaber
Copy link
Contributor

I understand that #729 is based on a decision to change the SciML style itself, but this has a major impact on everyone using JuliaFormatter with SciMLStyle. We use SciMLStyle because it mostly fits our style, but we don't want to strictly follow the SciML style (especially not now).

Code that was perfectly readable before

function interact!(dv, v_particle_system, u_particle_system,
                   v_neighbor_system, u_neighbor_system, neighborhood_search,
                   particle_system::TotalLagrangianSPHSystem,
                   neighbor_system::TotalLagrangianSPHSystem)
    interact_solid_solid!(dv, neighborhood_search, particle_system, neighbor_system)
end

suddenly becomes much less readable, where it's not clear where the arguments end and the body begins:

function interact!(dv, v_particle_system, u_particle_system,
    v_neighbor_system, u_neighbor_system, neighborhood_search,
    particle_system::TotalLagrangianSPHSystem,
    neighbor_system::TotalLagrangianSPHSystem)
    interact_solid_solid!(dv, neighborhood_search, particle_system, neighbor_system)
end

For many users, this means a hard breaking change, as it's not configurable.

I'm not asking to undo this decision, I'm just asking to make this optional to allow users to stay with the old, well-known style.

@visr
Copy link
Contributor

visr commented Jun 7, 2023

Since the non-configurable nesting rules came from YAS, you can get pretty close to the old behavior using YASStyle and changing some options to be like SciMLStyle. Perhaps others can get it closer, but these are the settings that should matter based on the docs:

style = "yas"

# use SciML options that are not in YAS
whitespace_typedefs = true
normalize_line_endings = "unix"

# change YAS options that differ from SciML
import_to_using = false
pipe_to_function_call = false
short_to_long_function_def = false
always_use_return = false
whitespace_in_kwargs = true
join_lines_based_on_source = false
separate_kwargs_with_semicolon = false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants