For anyone who has code on GitHub, there is a new code scanning GitHub action using HLint, which uploads results from HLint to GitHub code scanning dashboards:
It can track issues in Haskell code that HLint may suggest improvements for in GitHub’s code scanning dashboards. The action can also serve as a status check for pull requests, and could arguably provide a nicer interface for contributors to inspect what issues their code may have.
This is what a code scanning dashboard with issues reported by HLint looks like:
GitHub code scanning is able to display the file and lines where the issue is located, and it shows the message explaining the issue and possible improvements as suggested by HLint.
I hope this proves useful to those maintaining Haskell code on GitHub.
HLint has recently incorporated support for SARIF output, which is an open format that GitHub uses to receive static analysis results. However, GitHub code scanning has a few idiosyncracies which make its use of the output directly from HLint somewhat janky. This is why haskell-actions/hlint-scan does some amount of rewriting of the SARIF output from HLint before uploading it to GitHub code scanning, despite the SARIF output being fine on its own.