Created
August 23, 2023 13:15
-
-
Save ianfixes/04dc060fecb2c3993907634e5a7aebf0 to your computer and use it in GitHub Desktop.
Convert colon-delimited linting report to GitHub Annotations format
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Pretty sure this will work, | |
run: | |
- | | |
gofmt -l . 2>&1 | |
| jq -Rn '[ | |
inputs | |
| split(":") | |
| { | |
"path": .[0], | |
"start_line": (.[1] | tonumber), | |
"end_line": (.[1] | tonumber), | |
"start_column": (.[2] | tonumber), | |
"end_column": (.[2] | tonumber), | |
"annotation_level": "failure", | |
"annotation": (.[3:]|join(":")|gsub("^ +| +$";"")) | |
} | |
]' > annotations.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment