-
-
Notifications
You must be signed in to change notification settings - Fork 18
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
Add hlint gh-action ignoring one suggestion. #85
base: main
Are you sure you want to change the base?
Changes from 2 commits
a137498
5b7f1b4
6ca0c0d
f707bd9
18e2b6f
ef8b7cd
7766718
2e3cfd6
29290ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: hlint | ||
|
||
on: | ||
pull_request: | ||
push: | ||
|
||
jobs: | ||
build: | ||
name: hlint | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up HLint | ||
uses: haskell/actions/hlint-setup@v2 | ||
with: | ||
version: "3.3.6" | ||
|
||
- name: Run Hlint | ||
uses: haskell/actions/hlint-run@v2 | ||
with: | ||
path: '["src/", "test/"]' | ||
fail-on: suggestion | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Warnings currently triggered by your code | ||
- ignore: {name: "Unused LANGUAGE pragma"} # 1 hint | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be better to just remove the unused pragma rather than ignore it 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd intended to do this in two steps. Add the gh-action that passes then on one or more separate PRs fix lint suggestions while keeping the gh-action in the green. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like to not have ignored suggestions even in the meantime, so I prefer to have everything done in one 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My own preference is for having the ignores in there as a TODO list but I did as you asked. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it could be added ass another job to the existing workflow we have for the project 👌🏼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason for having a separate action is that hlint runs very quickly (doesn't require a build).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This step could be done before the
Build
stepThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did this but in testing found it gave less feedback. I had to rely on trusting that running hlint locally would work the same as when run in the workflow. This can be seen by comparing hlint and hlint-standalone workflow runs. The
CI/hlint
job was last triggered when I edited the workflow whereas thehlint-standalone/hlint-standalone
job was triggered when I made any change (hlint is lightweight so this doesn't cost much).