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

policy status CLI: Render guidance as markdown #982

Merged
merged 1 commit into from
Sep 25, 2023
Merged

policy status CLI: Render guidance as markdown #982

merged 1 commit into from
Sep 25, 2023

Conversation

JAORMX
Copy link
Contributor

@JAORMX JAORMX commented Sep 19, 2023

This providers a nicer view of the rule's policy status by rendering
the rule as markdown. Note that this is only applicable to the CLI
and would not affect our API at all. If the renderer fails, we'd just
render the raw text.

@JAORMX JAORMX requested review from evankanderson, jhrozek and lukehinds and removed request for evankanderson and jhrozek September 19, 2023 10:44
Copy link
Member

@evankanderson evankanderson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking on go.mod cleanup -- not sure what happened there exactly.

The other one on RenderWithEnvironmentConfig is optional.

go.mod Outdated Show resolved Hide resolved
@@ -160,5 +161,10 @@ func guidanceOrEncouragement(status, guidance string) string {
return "No guidance available for this rule 😞"
}

return guidance
renderedGuidance, err := glamour.Render(guidance, "dark")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to use RenderWithEnvironmentConfig, which will allow users to set GLAMOUR_STYLE environment variable to choose their styling?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking we should use a consize color scheme instead, I added a TODO with a reference to #1006

go.mod Outdated Show resolved Hide resolved
evankanderson
evankanderson previously approved these changes Sep 19, 2023
rdimitrov
rdimitrov previously approved these changes Sep 22, 2023
@JAORMX JAORMX changed the title rule types CLI: Render guidance as markdown policy status CLI: Render guidance as markdown Sep 23, 2023
This providers a nicer view of the rule's policy status by rendering
the rule as markdown. Note that this is only applicable to the CLI
and would not affect our API at all. If the renderer fails, we'd just
render the raw text.
@JAORMX JAORMX merged commit 9ea0d54 into main Sep 25, 2023
12 checks passed
@JAORMX JAORMX deleted the render-md branch September 25, 2023 14:31
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.

3 participants