Ormolu GitHub action
Go to file
2023-04-05 11:50:25 +02:00
.github Bump actions/checkout from 2 to 3 2023-01-26 14:54:25 +01:00
dist Add version input 2023-02-15 21:10:04 +01:00
test-code Test on linux, mac, windows 2020-11-15 21:45:25 +01:00
.gitignore Initial commit 2020-10-12 23:14:36 +02:00
action.yml Adjustments due to the move to haskell-actions and renaming to run-ormolu 2023-04-05 11:50:25 +02:00
CHANGELOG.md New release v11 2023-03-20 22:34:34 +01:00
index.js Add version input 2023-02-15 21:10:04 +01:00
LICENSE.md Initial commit 2020-10-12 23:14:36 +02:00
package-lock.json Define inputs, do globbing for source files 2020-10-14 23:00:30 +02:00
package.json Adjustments due to the move to haskell-actions and renaming to run-ormolu 2023-04-05 11:50:25 +02:00
README.md Adjustments due to the move to haskell-actions and renaming to run-ormolu 2023-04-05 11:50:25 +02:00

Ormolu action

CI

This is Ormolu action that helps to ensure that your Haskell project is formatted with Ormolu. The action tries to find all Haskell source code files in your repository and fails if any of them is not formatted. In case of failure it prints the diff between the actual contents of the file and its formatted version.

Inputs

  • pattern Glob patterns that are used to find source files to format. It is possible to specify several patterns by putting each on a new line.
  • respect-cabal-files Whether to try to locate Cabal files and take into account their default-extensions and default-language settings (default: true).
  • follow-symbolic-links Whether to follow symbolic links (default: true).
  • extra-args Extra arguments to pass to Ormolu.
  • version The version number of Ormolu to use. Defaults to "latest".

Windows

If you are running a workflow on Windows, be wary of Git's core.autocrlf. Ormolu always converts CRLF endings to LF endings which may result in spurious diffs, so you probably want to disable core.autocrlf:

$ git config --global core.autocrlf false

Example usage

In the simple case all you need to do is to add this step to your job:

- uses: haskell-actions/run-ormolu@v11

However, if you are using a matrix, then it is more efficient to have a separate job for checking of formatting:

jobs:
  ormolu:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: haskell-actions/run-ormolu@v11
  build:
    runs-on: ubuntu-latest
    needs: ormolu
    ...

Here, the build job depends on ormolu and will not run unless ormolu passes.