diddlesnaps / snapcraft-review-action

GitHub Action to review your built Snap package using the same tools as the Snap Store
MIT License
2 stars 1 forks source link

Generate annotations based on review-tools errors #1

Open jhenstridge opened 4 years ago

jhenstridge commented 4 years ago

It'd be nice if the action generated annotations based on any warnings or errors detected by review-tools.snap-review. As I understand it, these will be surfaced on pull requests assuming that they're associated with a changed file.

There are two

  1. output ::warning or ::error commands as described here:

    https://help.github.com/en/actions/automating-your-workflow-with-github-actions/development-tools-for-github-actions#set-a-warning-message-warning

    It doesn't look like the @actions/core library has a public API to output such a command with the file/line/column annotations, but it should be fine to output them manually.

  2. Create a problem matcher that can parse snap-review's output:

    https://github.com/actions/toolkit/blob/master/docs/commands.md#problem-matchers

I think (2) may be a bit difficult with the text output of snap-review, so it might be best to ask for json output and use (1). This would also make it possible to attach the problems to the snapcraft.yaml file.

lucyllewy commented 4 years ago

I've given this a poke in the branch experimental-yaml-mapping. Please give it a poke. I'm not very pleased, but it does work for a couple of the test cases I've thrown at it at least.