|
|
|
@ -177,7 +177,7 @@ any of the input files are incorrectly formatted. As an example, the following i |
|
|
|
can be used: |
|
|
|
can be used: |
|
|
|
|
|
|
|
|
|
|
|
```sh |
|
|
|
```sh |
|
|
|
git ls-files -z -- '*.jl' | xargs -0 julia -m Runic --check --diff |
|
|
|
git ls-files -z -- '*.jl' | xargs -0 --no-run-if-empty julia -m Runic --check --diff |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
This will run Runic's check mode (`--check`) on all `.jl` files in the repository and print |
|
|
|
This will run Runic's check mode (`--check`) on all `.jl` files in the repository and print |
|
|
|
@ -187,7 +187,8 @@ formatted the exit code will be non-zero. |
|
|
|
|
|
|
|
|
|
|
|
### Github Actions |
|
|
|
### Github Actions |
|
|
|
|
|
|
|
|
|
|
|
Here is a complete workflow file for running Runic on Github Actions: |
|
|
|
You can use [`fredrikekre/runic-action`](https://github.com/fredrikekre/runic-action) to run |
|
|
|
|
|
|
|
Runic on Github Actions: |
|
|
|
|
|
|
|
|
|
|
|
```yaml |
|
|
|
```yaml |
|
|
|
name: Runic formatting |
|
|
|
name: Runic formatting |
|
|
|
@ -205,18 +206,22 @@ jobs: |
|
|
|
runs-on: ubuntu-latest |
|
|
|
runs-on: ubuntu-latest |
|
|
|
steps: |
|
|
|
steps: |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
- uses: actions/checkout@v4 |
|
|
|
- uses: julia-actions/setup-julia@v2 |
|
|
|
# - uses: julia-actions/setup-julia@v2 |
|
|
|
|
|
|
|
# with: |
|
|
|
|
|
|
|
# version: '1' |
|
|
|
|
|
|
|
# - uses: julia-actions/cache@v2 |
|
|
|
|
|
|
|
- uses: fredrikekre/runic-action@v1 |
|
|
|
with: |
|
|
|
with: |
|
|
|
version: "nightly" # Only nightly have the -m flag currently |
|
|
|
version: '1' |
|
|
|
- uses: julia-actions/cache@v2 |
|
|
|
|
|
|
|
- name: Install Runic |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
julia --color=yes --project=@runic -e 'using Pkg; Pkg.add(url = "https://github.com/fredrikekre/Runic.jl")' |
|
|
|
|
|
|
|
- name: Run Runic |
|
|
|
|
|
|
|
run: | |
|
|
|
|
|
|
|
git ls-files -z -- '*.jl' | xargs -0 julia --project=@runic -m Runic --check --diff |
|
|
|
|
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
See [`fredrikekre/runic-action`](https://github.com/fredrikekre/runic-action) for details. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
> [!IMPORTANT] |
|
|
|
|
|
|
|
> It is *highly recommended* to pin the Runic version to a full version number (e.g. |
|
|
|
|
|
|
|
> `major.minor.patch`) to avoid CI failures due to changes in Runic.jl because even |
|
|
|
|
|
|
|
> formatting bug fixes may result in formatting changes that would then fail the workflow. |
|
|
|
|
|
|
|
|
|
|
|
### Git Hooks |
|
|
|
### Git Hooks |
|
|
|
|
|
|
|
|
|
|
|
Runic can be run in a |
|
|
|
Runic can be run in a |
|
|
|
|