-
Notifications
You must be signed in to change notification settings - Fork 112
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
Apply new formatter version #1842
Apply new formatter version #1842
Conversation
Review checklistThis checklist is meant to assist creators of PRs (to let them know what reviewers will typically look for) and reviewers (to guide them in a structured review process). Items do not need to be checked explicitly for a PR to be eligible for merging. Purpose and scope
Code quality
Documentation
Testing
Performance
Verification
Created with ❤️ by the Trixi.jl community. |
] | ||
mpi_mesh_info.mpi_mortars.local_neighbor_ids[local_mpi_mortar_id] = [current_index + | ||
1] | ||
mpi_mesh_info.mpi_mortars.local_neighbor_positions[local_mpi_mortar_id] = [map_iface_to_ichild_to_position[iface + 1][t8_element_child_id(eclass_scheme, element) + 1]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line gets really long.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you check if a line break behind e.g. the =
gets removed from the formater?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, after the =
, it does get removed. I've pushed an alternative in f393d48 with a line break after the first closing bracket.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, never mind. This does not work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So none of the tried options work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately yes. We could, however, give shorter names to map_iface_to_ichild_to_position[iface + 1]
and t8_element_child_id(eclass_scheme, element) + 1
before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I would hesitate to change variable names due to formatter issues - probably we have a new formatting in 2-3 months anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should just push this through to get the other PRs going
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1842 +/- ##
=======================================
Coverage 96.38% 96.38%
=======================================
Files 455 455
Lines 36391 36391
=======================================
Hits 35074 35074
Misses 1317 1317
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the more compact code
CI failures seem to be a server error on the codecov side. |
map_iface_to_ichild_to_position = [ | ||
# 0 1 2 3 4 5 6 7 ichild/iface | ||
[1, 0, 2, 0, 3, 0, 4, 0], # 0 | ||
[0, 1, 0, 2, 0, 3, 0, 4], # 1 | ||
[1, 2, 0, 0, 3, 4, 0, 0], # 2 | ||
[0, 0, 1, 2, 0, 0, 3, 4], # 3 | ||
[1, 2, 3, 4, 0, 0, 0, 0], # 4 | ||
[0, 0, 0, 0, 1, 2, 3, 4], # 5 | ||
] | ||
# 0 1 2 3 4 5 6 7 ichild/iface | ||
[1, 0, 2, 0, 3, 0, 4, 0], # 0 | ||
[0, 1, 0, 2, 0, 3, 0, 4], # 1 | ||
[1, 2, 0, 0, 3, 4, 0, 0], # 2 | ||
[0, 0, 1, 2, 0, 0, 3, 4], # 3 | ||
[1, 2, 3, 4, 0, 0, 0, 0], # 4 | ||
[0, 0, 0, 0, 1, 2, 3, 4]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is absolutely terrible. Why do these things always happen in new versions of JuliaFormatter?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a PR reverting the changes in JuliaFormatter: domluna/JuliaFormatter.jl#807 |
Question is whether we should pin the version of the Julia formatter to something fixed we are happy with? Otherwise stuff like this will come up again and probably confuse / de-motivate people in contributing. |
Some are indeed taking this approach SciML/ModelingToolkit.jl#2456 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a PR reverting the changes in JuliaFormatter: domluna/JuliaFormatter.jl#807 I ran JuliaFormatter on Trixi.jl
main
with this patch, and there are no changes. If my PR in JuliaFormatter is merged soon, we can avoid meging this huge PR and another subsequent PR reverting this PR again.
Thanks a lot, @efaulhaber! I would like to fix the version of JuliaFormatter (e.g., #1843) or wait for your patch to be accepted and released.
Maybe it would make sense to permanently fix the formatter version, so that development is not delayed by new versions. But then add a GitHub workflow to periodically check if a new version is available and perhaps automatically create a PR like the compat workflow. |
That sounds like a good idea 👍 |
Ok, then let's fix the JuliaFormatter version. Closing this. |
Due to domluna/JuliaFormatter.jl#792, which is part of the new version v1.0.46 from JuliaFormatter.jl released 13 hours ago, the formatting changes and CI fails. This PR applies the changes from the new version.