ModelingToolkit.jl
ModelingToolkit.jl copied to clipboard
refactor: format
Checklist
- [ ] Appropriate tests were added
- [ ] Any code changes were done in a way that does not break public API
- [ ] All documentation related to code changes were updated
- [ ] The new code follows the contributor guidelines, in particular the SciML Style Guide and COLPRAC.
- [ ] Any new documentation only uses public API
Additional context
Add any other context about the problem here.
Formatting failed 😅
Yeah, JuliaFormatter v2 doesn't like bipartite_graphs.jl for some reason and errors out in CI. This is formatted with v1 locally.
Would you prefer I make CI use v1?
No we should update to v2. We should just change the code to make it happy then.
I'll see if I can figure out what it is unhappy about. The error message is incredibly unhelpful. There also doesn't seem to be an option to increase the fixpoint iterations.
struct Matching{U, V <: AbstractVector} <: AbstractVector{Union{U, Int}} #=> :Unassigned =#
match::V
inv_match::Union{Nothing, V}
end
It specifically doesn't like that inline comment.
just put it above the struct.
https://github.com/domluna/JuliaFormatter.jl/issues/924
The comment is not very meaningful anyway, and putting it above the struct also fails. I've removed it. This will be a massive PR, unfortunately.
I'll push the changes, but I find a lot of it pretty questionable
conflict
Well yes, but I don't think upgrading to JuliaFormatter@2 is worth it. Most of these changes are nonsensical and worse code quality.
It's even split multidimensional array indexing into multiple lines in some places for some reason
Point them all out for @domluna