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 JuliaFormatterTool and format.jl script #1020

Merged
merged 1 commit into from
Oct 25, 2022

Conversation

mkitti
Copy link
Member

@mkitti mkitti commented Oct 25, 2022

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
Copy link
Member

musm commented Oct 25, 2022

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

@mkitti
Copy link
Member Author

mkitti commented Oct 25, 2022

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

@mkitti mkitti merged commit af62ebf into JuliaIO:master Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants