From de5291fc832bb7a8304c66fd238fc05bc1eda90a Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 18 Oct 2024 12:32:21 +0200 Subject: [PATCH] Recommend runic-action for GitHub Action config. --- README.md | 27 ++++++++++++++++----------- src/main.jl | 1 - 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 40e1c74..3aaf37d 100644 --- a/README.md +++ b/README.md @@ -177,7 +177,7 @@ any of the input files are incorrectly formatted. As an example, the following i can be used: ```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 @@ -187,7 +187,8 @@ formatted the exit code will be non-zero. ### 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 name: Runic formatting @@ -205,18 +206,22 @@ jobs: runs-on: ubuntu-latest steps: - 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: - version: "nightly" # Only nightly have the -m flag currently - - 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 + version: '1' ``` +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 Runic can be run in a diff --git a/src/main.jl b/src/main.jl index 1892607..0ef9060 100644 --- a/src/main.jl +++ b/src/main.jl @@ -104,7 +104,6 @@ function print_help() println(io) printstyled(io, "SYNOPSIS", bold = true) println(io) - println(io, " Runic.main - format Julia source code") println(io, " julia -m Runic [] ...") println(io) printstyled(io, "DESCRIPTION", bold = true)