pre-commit hooks for running JuliaFormatter.jl
-
requires
JuliaFormatter.jl
installed in your current julia package environment. i.e.,cd DIR_OF_YOUR_REPO/ julia # start julia REPL ] # enter Pkg mode activate . # activate the environment of the current dir status # there should be a JuliaFormatter installed
To use hooks, add the following code block to your .pre-commit-config.yaml
:
- repo: https://github.com/qiaojunfeng/pre-commit-julia-format
rev: 0.1.0 # use the most recent version
hooks:
- id: julia-format # formatter for Julia code
You can use the .JuliaFormatter.toml to specify the style.
- pre-commit: https://pre-commit.com/
- pre-commit supported hooks: https://pre-commit.com/hooks.html
- JuliaFormatter.jl: https://github.com/domluna/JuliaFormatter.jl
- Julia Blue Style: https://github.com/invenia/BlueStyle
- julia-format: https://github.com/julia-actions/julia-format