-
Notifications
You must be signed in to change notification settings - Fork 40
Update JuliaFormatter to v2 #298
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
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
function S_xx((::Type{Trivial})=Trivial, (::Type{T})=ComplexF64; | ||
spin=1 // 2) where {T<:Number} |
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 horrible
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 precisely why I haven't don't it yet...
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.
Thank you <3
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.
The JuliaFormatter team really did a number on their code and my formatting has never been happy since
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.
Any experience with trying Runic.jl instead of JuliaFormatter? I also don't like many of the formatting changes induced by v2.
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 have been trying it and while I quite like it, it’s a bit more involved to set up, and it’s annoying to switch back and forth. If we switch the entire quantumkithub I’m also okay with that
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 haven't tried it yet; does it cooperate as easily with VS Code (i.e. does it support "format on save"?). If so, then I wouldn't mind switching.
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.
It's not too hard to install in VScode but it's slightly more work than the usual setup. The instructions are on the Runic readme so it should be fine.
For comparison: #303 |
So what do you like the most? I think I like certain aspects of Runic, such as spaces around I do have to get used to the way Runic divides arguments of functions (calls or definitions) across multiple lines. |
I agree with Jutho here, there are some aspects of Runic that seem unnatural to me. I do like the fact that the rules are "set in stone" (unless a v2 is released) and splitting up overly long list comprehensions is a nice addition. The installation process is a bit more involved than JuliaFormatter, making the barrier for some less technologically inclined people to contribute to the codebase a bit higher, getting people to format their code now is sometimes already a hassle :) |
I think the JuliaFormatter v2 things that stand out are a lot uglier than the ones from Runic, and I have to admit that while I originally also wasn't convinced about how the arguments split, it doesn't bother me as much now. However, as @VictorVanthilt mentioned, most people don't have this set up, so it does increase the barrier for contributing. This is typically not a major problem, and could even be resolved with github actions, but it is definitely something to consider. I think the main issue is that it is very subjective and I don't think it matters all that much, as long as it is consistent. Having something that is easy might outweigh having something that looks nice, unless we all (more or less unanimously) agree that Runic looks better, in which case I'll try and set up some tooling to make this work. |
@pbrehmer , @Yue-Zhengyuan , @leburgel , @sanderdemeyer , I'm explicitly tagging all of you here in case you would like to share your opinions, since I would prefer to keep everything consistent across QuantumKitHub to also minimize the amount of tooling we have to maintain. |
I have a slight preference for keeping JuliaFormatter w.r.t. Runic for the reasons mentioned by Lukas and Victor. As for the version, I would be okay with either one (although I have a very slight preference for keeping v1 for now). The most important thing in my opinion is indeed, Like Lukas said, that we come to a conclusion here that we stick to throughout the whole QuantumKithub. |
Based on my first impressions I like the Runic style most since I find it very readable. I definitely appreciate the spaces around I agree that the technical hurdle Runic introduces is not ideal and I do find it slightly annoying that it is the non-standard option (since code formatting should really be standardized IMO and already be shipped with the language like with Rust for example). I also agree with Lukas that this problem could be taken care of with Github actions. Personally, I would slightly favor Runic. Overall though, I have to say that I don't have a strong opinion and would also be fine with using JuliaFormatter (v1 or v2) as long as it is used consistently. |
I prefer JuliaFormatter (with It's also OK if we finally decide to use the Runic style; it's not ideal, but much more tolerable for me. |
I agree with that sentiment, unfortunately # yas:
begin
begin
begin
begin
begin
begin
@tensor A[i j; k l] := longerasdfasdfasfasdftensorname123asdfasdfasdfasdfasdfasdf[i j;
k l] *
longtensoasdfasdfasdfasdfasdfrname2[i j k l m n o;
p q r s t o v]
end
end
end
end
end
end
begin # blue
begin
begin
begin
begin
begin
@tensor A[i j; k l] :=
longerasdfasdfasfasdftensorname123asdfasdfasdfasdfasdfasdf[
i j
k l
] * longtensoasdfasdfasdfasdfasdfrname2[
i j k l m n o
p q r s t o v
]
end
end
end
end
end
end So summarizing the sentiments:
So for me this boils down to either switching to Runic, or sticking with JuliaFormatter v2. |
This updates the version of the formatter to the latest version. There are a bunch of changes here that I don't really like, but it is definitely annoying to have to keep switching formatter versions between different packages so I don't think there is anything better to do about that.