Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
run-cabal-gild/dist/index.js linguist-generated=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
70 changes: 70 additions & 0 deletions run-cabal-gild/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
This code is an adaptation of https://github.com/haskell-actions/run-fourmolu
which in turn was an adaptation. Here is the license as included in the
`run-fourmolu` code:

This code was originally written by Mark Karpov for Ormolu:
https://github.com/mrkkrp/ormolu-action. The following is the license for that
code:

Copyright © 2020–2022 Mark Karpov

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name Mark Karpov nor the names of contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

------------------------------------------

The above repo has been updated to work with Fourmolu in this repository.
This new code uses the following license:

Copyright © 2022–present Bitnomial

All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name Mark Karpov nor the names of contributors may be used to
endorse or promote products derived from this software without specific
prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS “AS IS” AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 changes: 22 additions & 0 deletions run-cabal-gild/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# cabal-gild action

This `run-cabal-gild` GitHub Action helps to ensure that your Haskell project is
formatted with [cabal-gild](https://github.com/tfausak/cabal-gild). The action
tries to find all Cabal source code files in your repository and fails if any
of them are not formatted. In case of failure it prints the diff between the
actual contents of the file and its formatted version.

## Example usage

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

```yaml
- uses: input-output-hk/actions/run-cabal-gild@v1
with:
version: "1.7.0.1"
```

The `1.7.0.1` should be replaced with the version of cabal-gild you want to use. See
[cabal-gild releases](https://github.com/tfausak/cabal-gild/releases) for all cabal-gild versions.
If you don't specify this cabal-gild `version` input, the latest version of
cabal-gild will be used.
30 changes: 30 additions & 0 deletions run-cabal-gild/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Run cabal-gild'
description: 'Check formatting of Cabal code with cabal-gild'
inputs:
follow-symbolic-links:
required: false
description: >
Whether to follow symbolic links.
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

follow-symbolic-links is a boolean-like input but (unlike other actions in this repo) it does not declare type: boolean. Consider adding type: boolean (see e.g. base/action.yml and devx/action.yml) to make the metadata consistent and to ensure tooling/UIs treat it as a boolean.

Suggested change
Whether to follow symbolic links.
Whether to follow symbolic links.
type: boolean

Copilot uses AI. Check for mistakes.
default: true
extra-args:
required: false
description: >
Extra arguments to pass to Fourmolu.
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The extra-args input description says it passes arguments to Fourmolu, but this action runs cabal-gild. Update the description to refer to cabal-gild so users aren't misled.

Suggested change
Extra arguments to pass to Fourmolu.
Extra arguments to pass to cabal-gild.

Copilot uses AI. Check for mistakes.
version:
required: false
description: >
The version number of cabal-gild to use. Defaults to "latest". Example
version numbers -- `0.13.0.0`, `0.10.1.0`, etc. See
Comment on lines +12 to +17
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The version input examples look like Fourmolu versions (e.g. 0.13.0.0) rather than cabal-gild (README uses 1.7.0.1). This can confuse users; please update the example versions to match cabal-gild releases.

Suggested change
Extra arguments to pass to Fourmolu.
version:
required: false
description: >
The version number of cabal-gild to use. Defaults to "latest". Example
version numbers -- `0.13.0.0`, `0.10.1.0`, etc. See
Extra arguments to pass to cabal-gild.
version:
required: false
description: >
The version number of cabal-gild to use. Defaults to "latest". Example
version numbers -- `1.7.0.1`, `1.6.0.0`, etc. See

Copilot uses AI. Check for mistakes.
https://github.com/tfausak/cabal-gild/releases for a list of all releases.
default: latest
working-directory:
description: >
Directory in which to run cabal-gild. This also affects how the `pattern`
argument is interpretted, with Glob patterns being relative to this
`working-directory` argument.
Comment on lines +22 to +24
Copy link

Copilot AI Mar 4, 2026

Choose a reason for hiding this comment

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

The working-directory input description mentions a pattern argument and contains a spelling error ("interpretted"). There is no pattern input in this action, so the description should be updated to match the actual inputs and "interpreted" spelling.

Suggested change
Directory in which to run cabal-gild. This also affects how the `pattern`
argument is interpretted, with Glob patterns being relative to this
`working-directory` argument.
Directory in which to run cabal-gild. Paths and glob patterns will be
resolved relative to this directory.

Copilot uses AI. Check for mistakes.

Defaults to the repository root if not set.
required: false
runs:
using: 'node20'
main: 'dist/index.js'
255 changes: 255 additions & 0 deletions run-cabal-gild/dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading