Skip to content

Add hlint gh-action ignoring one suggestion.#85

Open
philderbeast wants to merge 9 commits intokowainik:mainfrom
typechecker:add/hlint
Open

Add hlint gh-action ignoring one suggestion.#85
philderbeast wants to merge 9 commits intokowainik:mainfrom
typechecker:add/hlint

Conversation

@philderbeast
Copy link
Copy Markdown

Automates a check for one of the checklist items for contributions, that hlint . has no hints.

@philderbeast philderbeast requested a review from vrom911 as a code owner June 30, 2022 13:50
Comment thread .hlint.yaml Outdated
@@ -0,0 +1,2 @@
# Warnings currently triggered by your code
- ignore: {name: "Unused LANGUAGE pragma"} # 1 hint
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 🙂

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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 🙂

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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.

Comment thread .github/workflows/hlint.yml Outdated
uses: haskell/actions/hlint-run@v2
with:
path: '["src/", "test/"]'
fail-on: suggestion No newline at end of file
Copy link
Copy Markdown
Member

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 👌🏼

Copy link
Copy Markdown
Author

@philderbeast philderbeast Sep 15, 2022

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).

Copy link
Copy Markdown
Member

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 step

Copy link
Copy Markdown
Author

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 the hlint-standalone/hlint-standalone job was triggered when I made any change (hlint is lightweight so this doesn't cost much).

@vrom911 vrom911 added the CI label Sep 15, 2022
@philderbeast philderbeast requested a review from vrom911 October 2, 2022 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants