Skip to content

Extend description of JuliaFormatter.jl and add Runic.jl - #150

Open
hakkelt wants to merge 1 commit into
modernjuliaworkflows:mainfrom
hakkelt:main
Open

hakkelt wants to merge 1 commit into
modernjuliaworkflows:mainfrom
hakkelt:main

Conversation

@hakkelt

@hakkelt hakkelt commented Nov 30, 2026

Copy link
Copy Markdown
  • Add mentions to styles supported by JuliaFormatter.jl, and example to customize a predefined style
  • Add example for CLI use of JuliaFormatter.jl
  • Add Runic.jl subsection

- Add mentions to styles supported by JuliaFormatter.jl, and example to customize a predefined style
- Add example for CLI use of JuliaFormatter.jl
- Add Runic.jl subsection

@adrhill adrhill left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

Comment thread src/sharing/index.md

To make your code easy to read, it is essential to follow a consistent set of guidelines.
The official [style guide](https://docs.julialang.org/en/v1/manual/style-guide/) is very short, so most people use third party style guides like [BlueStyle](https://github.com/JuliaDiff/BlueStyle) or [SciMLStyle](https://github.com/SciML/SciMLStyle).
The official [style guide](https://docs.julialang.org/en/v1/manual/style-guide/) is very short, so most people use third party style guides like [BlueStyle](https://github.com/JuliaDiff/BlueStyle), [SciMLStyle](https://github.com/SciML/SciMLStyle), or [YASGuide](https://github.com/jrevels/YASGuide).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think "YASGuide" is as popular as Blue/SciML/Runic, is there a particular reason you want to add it?

Comment thread src/sharing/index.md
Comment on lines +175 to +183
To override the defaults of the chosen style, you can add additional lines:

```toml
style = "blue"
indent = 2
margin = 100
remove_extra_newlines = false
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could keep MoJuWo a bit more concise by linking to the JuliaFormatter options instead: https://juliaeditorsupport.github.io/JuliaFormatter.jl/stable/formatting_options/#formatting-options

This also helps avoid drift.

Comment thread src/sharing/index.md
Comment on lines +191 to +198
Or you can install it as a command-line application:
```bash
# Install it once with:
julia -e 'using Pkg; Pkg.Apps.add("JuliaFormatter")'

# Then you can use it to format all files in a directory with multiple threads:
jlfmt --threads=6 -- --inplace -v src/
```

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this section is a great addition.
I'd suggest we keep it vanilla and drop the --threads argument though, leaving such defaults to JuliaFormatter.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also wondering what the extra -- does?

Comment thread src/sharing/index.md

Another approach, taken by [Runic.jl](https://github.com/fredrikekre/Runic.jl), is not to allow any customization, and format the code with a fixed set of rules (_"A code formatter with rules set in stone."_). It is known for its ease of use and very fast execution.

Run the following to install and run as a command-line application:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Run the following to install and run as a command-line application:
Run the following to install Runic and run it as a command-line application:

This branch has not been deployed

No deployments
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