TensorBFS / TensorInference.jl

Probabilistic inference using contraction of tensor networks
https://tensorbfs.github.io/TensorInference.jl/
MIT License
18 stars 2 forks source link

Define a format style and format all files using JuliaFormatter.jl #17

Closed mroavi closed 1 year ago

mroavi commented 1 year ago

Adds a .JuliaFormatter.toml file to define the format style. Formats all files using this style.

GiggleLiu commented 1 year ago

Looks great! Never used JuliaFormattter, can you comment a bit on how to run the formatter?

mroavi commented 1 year ago

JuliaFormatter.jl is the formatter used by LanguageServer.jl. This means that you can use it from VsCode (as shown here) or from Neovim using its LSP client. You can also use it standalone like this:

julia> using JuliaFormatter

# Recursively formats all Julia files in the current directory
julia> format(".")

# Formats an individual file
julia> format_file("foo.jl")

# Formats a string (contents of a Julia file)
julia> format_text(str)

# Formats all files in the package directory of a `Module`
julia> format(FooPackage)

see the docs for more details.