Open AndreasAZiegler opened 3 years ago
you might be able to make it work if include it with PackageCompiler
Thanks for your input @domluna. Could you elaborate a bit more what you mean? According to this description about PackageCompiler there are three ways how to use it. Which approach do you mean?
@kdheepak may know more about this since he was something similar working for the vim plugin
I case other people find it helpful, I'm building a binary using this command
julia --project=. --startup-file=no -e 'using PackageCompiler; create_app(".", "compiled"; precompile_execution_file="src/other/precompile.jl", force=true)'
In order for that to work you likely first have to add PackageCompiler
like so:
julia --project=. -e 'using Pkg; Pkg.add("PackageCompiler")'
The created binary then lies in compiled/bin/JuliaFormatter
and can be called as path/to/repo/compiled/bin/JuliaFormatter somefile.jl
to (very quickly) in-place format somefile.jl
.
Note that I had to perform two minor fixes to get it working, though, which can be seen here.
(I'm still on v1.0.62 right now due to the issues with v2.)
I then hooked this up to my Emacs so that upon saving the current file is formatted.
I'm using ALE for linting and fixing for C++ and Python. I would love to use JuliaFormatter with ALE as well. As far as I understand it, JuliaFormatter has to be run as a single executable to make it work with ALE.