-
Notifications
You must be signed in to change notification settings - Fork 197
Enable JuliaFormatter #989
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
|
Putting the git-ignore-blame-revs in the PR won't work (in the same way it didn't work in GLM). Generally, I think we should rediscuss whether we actually want to use JuliaFormatter. Both versions 1 and 2 suffer from long-standing issues (eg generally it is not idempotent) and Runic seems better maintained and of higher quality and with better tooling (eg official GH action). Therefore important parts of the ecosystem (eg Documenter, DifferentiationInterface, all SciML repos, and actually also PDMats and StatsFuns) switched to Runic. |
What do you mean? IIRC you need to configure this manually if you want this to work locally, but GitHub seems to use it by default. For example this file has been changed a lot by the JuliaFormatter commit but it's not shown in blame: https://github.com/JuliaStats/GLM.jl/blame/master/docs/make.jl
As I said I don't have a strong preference as I haven't used Runic. GitHub support seems equivalent since there's https://github.com/julia-actions/julia-format for JuliaFormatter, right? Conversely, JuliaFormatter is included in the Julia VScode extension so it's easier to use especially for external contributors. Maybe the most important point: looking at the Runic docs, AFAICT it doesn't allow enforcing a maximal line length, so that means we'll still have to take care of that manually. Apparently Runic may implement this feature at some point though there are no concrete plans (fredrikekre/Runic.jl#61). |
You have to add the commit that ends up on the master branch, otherwise it won't work. That's what happened in GLM and what I fixed in JuliaStats/GLM.jl#604 |
Add a JuliaFormatter style using the YAS style, apply it to the code base, and enable a GitHub workflow to add suggestions to PRs to follow the style. Copied from JuliaStats/GLM.jl#603.