Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskell/actions/hlint-run doesn't detect .hlint.yaml file in working directory #12

Open
benrbray opened this issue Oct 3, 2023 · 4 comments

Comments

@benrbray
Copy link

benrbray commented Oct 3, 2023

(cloned from haskell/actions#277 by request of @andreasabel )

Question

Does the hlint-run action currently support .hlint.yaml files? If so, what is the recommended way to pass the .hlint.yaml file to the action?

Details

I have the following project structure:

/
├─ .github/
│  ├─ workflows/
│  │  ├─ hlint.yaml
├─ project/
│  ├─ src/
│  ├─ project.cabal
│  ├─ .hlint.yml

Here is .hlint.yaml:

- ignore: {name: Redundant bracket}

Here is (the relevant part of) .github/workflows/hlint.yaml:

name: build
on:
  push:
    branches: [main]
  pull_request:
    branches: [main]

permissions:
  contents: read

jobs:  
  hlint:
    runs-on: ubuntu-latest
    defaults:
      run:
        working-directory: project
    steps:
    - uses: actions/checkout@v3

    - name: 'Set up HLint'
      uses: haskell/actions/hlint-setup@v2

    - name: 'Run HLint'
      uses: haskell/actions/hlint-run@v2
      with:
        path: .
        fail-on: never

In CI, the hlint-run action is successful, but I still get a "redundant bracket" warning. Locally, running hlint automatically detects the .hlint.yaml file and suppresses the warning.

@mihaimaruseac
Copy link
Collaborator

I'll take a look into this

@phadej
Copy link

phadej commented Apr 21, 2024

Having a configuration option to specify .hlint.yml location would be great

@mihaimaruseac
Copy link
Collaborator

I completely forgot about this one. I'll try to handle this by July 4th long weekend :)

As a side note, I'm considering deprecating hlint-{setup,run} pair in favor of https://github.com/haskell-actions/hlint-scan but I need to make sure all current users can migrate without being impacted too severely. Can you please take a look and see if you can use hlint-scan instead? Thank you!

@balacij
Copy link

balacij commented Jun 17, 2024

At least temporarily, you can get around this by setting hlint-bin to hlint --hint=<path/to/file> (#20 (comment)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants