JuliaIO / HDF5.jl

Save and load data in the HDF5 file format from Julia
https://juliaio.github.io/HDF5.jl
MIT License
386 stars 140 forks source link

Add JuliaFormatterTool and format.jl script #1020

Closed mkitti closed 1 year ago

mkitti commented 1 year ago

This adds a utility script to make using JuliaFormatter easier. It runs JuliaFormatter.format in a loop after you press enter. That idea is that you run this on the side or suspended. When you format, just resume the program and press enter.

$ julia contrib/format/format.jl
  Activating project at `~/.julia/dev/HDF5/contrib/format`
  No Changes to `~/.julia/dev/HDF5/contrib/format/Project.toml`
  No Changes to `~/.julia/dev/HDF5/contrib/format/Manifest.toml`

Welcome to Julia Formatter Tool!
--------------------------------

Press enter to format the directory ~/.julia/dev/HDF5 or `q[enter]` to quit
format.jl>
Applying JuliaFormatter...
┌ Info: Is the current directory formatted?
│   target_dir = "~/.julia/dev/HDF5"
└   format(target_dir) = true

Press enter to format the directory ~/.julia/dev/HDF5 or `q[enter]` to quit
format.jl>
Applying JuliaFormatter...
┌ Info: Is the current directory formatted?
│   target_dir = "~/.julia/dev/HDF5"
└   format(target_dir) = true
musm commented 1 year ago

LGTM, would also be a good candidate for a github action

mkitti commented 1 year ago

There seems to be a Github action setup here that creates a pull request: https://github.com/julia-actions/julia-format/blob/master/workflows/format_pr.yml