Skip to content
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

Improve error message with title, description, and examples #10

Merged
merged 5 commits into from
Mar 24, 2024

Conversation

AndreasMadsen
Copy link
Contributor

@AndreasMadsen AndreasMadsen commented Jan 12, 2024

JSON Schema allows for describing the rule with a title, description, and examples. However, currently only the automated error message is displayed.

This PR added the title to the CLI tool. This is identical to how the vs-code displays the error.

The PR also adds the hover content to the CI output. The hover content is displayed when a user hovers a property or content in an editor. This hover details includes the title, description, and examples in a formatted structure. Note, that the yaml service outputs Markdown. However, github-actions assumes ANSI outputs. Hence, a converter is used.

Colors are only displayed when the user adds:

env:
   FORCE_COLOR: true

to their action.yaml file. This logic is controlled by https://github.com/chalk/supports-color. Regardless, they only show up in the console, not the review comments.

Example showing the new output format:


Screenshot 2024-01-12 at 11 31 52

Previousely only String does not match the pattern of "^https:\/\/youtu\.be\/[a-zA-Z0-9\-_]{11}$". was shown.

For the CLI, only the source (i.e. title property) is added.
FOr the CI, the hover information (title, description, examples) are
added and formatted according to YAMLHover.
@InoUno
Copy link
Owner

InoUno commented Mar 24, 2024

Very cool stuff, thanks again!

I'll merge and rebuild to ensure it's up to date.

@InoUno InoUno merged commit 0a58256 into InoUno:develop Mar 24, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants