An open API service indexing awesome lists of open source software.

https://github.com/freckle/weeder-action

Run Weeder to uncover unused Haskell functions
https://github.com/freckle/weeder-action

actions ghvm-managed haskell

Last synced: 27 days ago
JSON representation

Run Weeder to uncover unused Haskell functions

Awesome Lists containing this project

README

          

# Weeder Action

GitHub Action to run Weeder to find any unused functions in a Haskell project
and annotate the Build with their locations.

![Example in Diff](./example-in-diff.png)

## Prerequisites

See the [Weeder README][weeder] for project requirements.

[weeder]: https://github.com/ocharles/weeder#readme

You will need to run this step in the same Job as you compile your project, or
make the `.hie` files available some other way.

## Usage

```yaml
steps:
- uses: actions/checkout@v4
- id: stack
uses: freckle/stack-action@v5
- uses: freckle/weeder-action@v3
with:
ghc-version: ${{ steps.stack.outputs.compiler-version }}
```

## Inputs

| name | description | required | default |
| ------------------- | ------------------------------------------------------------------------- | -------- | -------------------- |
| `ghc-version` |

Full version of GHC your project uses, to ensure HIE compatibility

| `true` | `""` |
| `weeder-arguments` |

Arguments to pass when invoking weeder

| `false` | `--require-hs-files` |
| `working-directory` |

Change to this directory before operating

| `false` | `.` |
| `fail` |

Fail the build if unused functions found?

| `false` | `true` |

## Outputs

| name | description |
| ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `log` |

Path to a file containing found weeds in JSON format; a list of objects with the keys identifier, file, and line.

|

## Release

To trigger a release (and update the `@v{major}` tag), merge a commit to `main`
that follows [Conventional Commits][]. In short,

- `fix:` to trigger a patch release,
- `feat:` for minor, and
- `feat!:` and major

We don't enforce conventional commits generally (though you are free do so),
it's only required if you want to trigger release.

[conventional commits]: https://www.conventionalcommits.org/en/v1.0.0/#summary

---

[LICENSE](./LICENSE)