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

Formatting is ugly sometimes #1758

Open
efaulhaber opened this issue Nov 28, 2023 · 5 comments
Open

Formatting is ugly sometimes #1758

efaulhaber opened this issue Nov 28, 2023 · 5 comments
Labels

Comments

@efaulhaber
Copy link
Member

This is ugly:

@inline function ncomponents(::AbstractCompressibleEulerMulticomponentEquations{NDIMS,
NVARS,
NCOMP}) where {
NDIMS,
NVARS,
NCOMP
}

This as well:

function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{
GradientVariablesPrimitive
})
cons2prim
end
function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{
GradientVariablesEntropy
})

This could probably be fixed in JuliaFormatter.

@efaulhaber
Copy link
Member Author

I didn't just create this issue for fun. Here is a fix for the second part:
domluna/JuliaFormatter.jl#785

This changes the second part to

- function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{
-                                                                                 GradientVariablesPrimitive
-                                                                                 })
+ function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{GradientVariablesPrimitive})
    cons2prim
end
- function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{
-                                                                                 GradientVariablesEntropy
-                                                                                 })
+ function gradient_variable_transformation(::CompressibleNavierStokesDiffusion2D{GradientVariablesEntropy})

When applied to all of src and test, it looks like this: #1759.

@ranocha
Copy link
Member

ranocha commented Nov 29, 2023

Nice, thanks! Is your PR to JuliaFormatter.jl already accepted and released?

@ranocha ranocha linked a pull request Nov 29, 2023 that will close this issue
@efaulhaber
Copy link
Member Author

efaulhaber commented Nov 29, 2023

It's merged, but not yet released.
But this only solves the second part. The first code snippet will still look ugly, so let's keep this issue open.

@efaulhaber
Copy link
Member Author

Now it's released and #1759 is ready to merge.

@efaulhaber
Copy link
Member Author

See my comment above. I only fixed the second problem.

@efaulhaber efaulhaber reopened this Dec 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants