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

Add Runic.jl as formatter for julia #331

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ The format is based on [Keep a Changelog].
[Ocaml](https://ocaml.org/) ([#306]).

### Formatters
* [Runic.jl](https://github.com/fredrikekre/Runic.jl) for
[Julia](https://julialang.org) ([#331])
* `vfmt` for
[vlang](https://vlang.io/) ([#324]).
* [`typstyle`](https://github.com/Enter-tainer/typstyle) for
Expand Down Expand Up @@ -59,6 +61,7 @@ The format is based on [Keep a Changelog].
[#325]: https://github.com/radian-software/apheleia/pull/325
[#326]: https://github.com/radian-software/apheleia/pull/326
[#327]: https://github.com/radian-software/apheleia/pull/327
[#331]: https://github.com/radian-software/apheleia/pull/331

## 4.2 (released 2024-08-03)
### Changes
Expand Down
3 changes: 3 additions & 0 deletions apheleia-formatters.el
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
"--fix" "--fix-only"
"--stdin-filename" filepath
"-"))
(runic . ("julia" "--project=@runic" "-e"
"using Runic; exit(Runic.main(ARGS))" "--"))
(snakefmt . ("snakefmt"
(apheleia-formatters-fill-column "--line-length")
"-"))
Expand Down Expand Up @@ -340,6 +342,7 @@ rather than using this system."
(js-ts-mode . prettier-javascript)
(json-mode . prettier-json)
(json-ts-mode . prettier-json)
(julia-mode . runic)
(kotlin-mode . ktlint)
(kotlin-ts-mode . ktlint)
(latex-mode . latexindent)
Expand Down
6 changes: 6 additions & 0 deletions test/formatters/installers/runic.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# install recent julia through JuliaUp
curl -fsSL https://install.julialang.org | sh -s -- --yes
ln -s /root/.juliaup/bin/julia /usr/bin/julia
chmod +x /usr/bin/julia
# install Runic.jl in @runic shared project
julia --project=@runic -e 'using Pkg; Pkg.add("Runic")'
7 changes: 7 additions & 0 deletions test/formatters/samplecode/runic/in.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

dist(p1,p2)=sqrt((p1[1]-p2[1])^2+(p1[2]-p2[2]^2))

function main(a,b)
return c =
magicalfunction(dist(a,b))
end
6 changes: 6 additions & 0 deletions test/formatters/samplecode/runic/out.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dist(p1, p2) = sqrt((p1[1] - p2[1])^2 + (p1[2] - p2[2]^2))

function main(a, b)
return c =
magicalfunction(dist(a, b))
end
Loading