@ -7,9 +7,9 @@ top of [JuliaSyntax.jl](https://github.com/JuliaLang/JuliaSyntax.jl).
@@ -7,9 +7,9 @@ top of [JuliaSyntax.jl](https://github.com/JuliaLang/JuliaSyntax.jl).
Similarly to [`gofmt`](https://pkg.go.dev/cmd/gofmt), Runic have *no configuration*. The
formatting rules are set in stone (although not yet complete). The following
[quote](https://www.youtube.com/watch?v=PAAkCSZUG1c&t=523s) about `gofmt` is relevant also
to Runic:
formatting rules are set in stone (although not yet complete). This approach is something
that is appreciated by most Go programmers, see for example the following
@ -40,7 +40,7 @@ invoked with the `-m` flag. See the output of `julia -m Runic --help` for detail
@@ -40,7 +40,7 @@ invoked with the `-m` flag. See the output of `julia -m Runic --help` for detail
> julia -e 'using Runic; exit(Runic.main(ARGS))' -- <args>
> ```
```sh
```
$ julia-master -m Runic --help
NAME
Runic.main - format Julia source code
@ -87,9 +87,12 @@ In addition to the CLI there is also the two function `Runic.format_file` and
@@ -87,9 +87,12 @@ In addition to the CLI there is also the two function `Runic.format_file` and
`Runic.format_string`. See their respective docstrings for details.
## CI configuration
## Checking formatting
To run Runic in a CI environment you can execute the following command:
Runic has a check-mode that verifies whether files are correctly formatted or not. This mode
is enabled with the `--check` flag. In check mode Runic will exit with a non-zero code if
any of the input files are incorrectly formatted. As an example, the following invocation
can be used:
```sh
julia -m Runic --check --diff $(git ls-files -- '*.jl')
@ -102,11 +105,10 @@ formatted the exit code will be non-zero.
@@ -102,11 +105,10 @@ formatted the exit code will be non-zero.
### Github Actions
Here is a complete example of how to run Runic in a Github Actions workflow:
Here is a complete workflow file for running Runic on Github Actions: