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

Pretty up the pretty-printer. #1451

Merged
merged 6 commits into from Oct 31, 2023
Merged

Conversation

craigbox
Copy link
Contributor

This PR makes Kubescape 3.0's pretty-printer a bit more pretty, and more in line with the original design ideals.

Signed-off-by: Craig Box craigb@armosec.io

Signed-off-by: Craig Box <craigb@armosec.io>
Signed-off-by: Craig Box <craigb@armosec.io>
@dwertent
Copy link
Contributor

@craigbox Can you please fix the tests?

Signed-off-by: Craig Box <craigb@armosec.io>
Signed-off-by: Craig Box <craigb@armosec.io>
@craigbox
Copy link
Contributor Author

craigbox commented Oct 31, 2023

The test failure I can see is core/pkg/resultshandling/reporter/v2/reporteventreceiver_test.go:126. This PR has changed

		cautils.InfoTextDisplay(os.Stderr, fmt.Sprintf("\n%s\n", txt))
		cautils.SimpleDisplay(os.Stderr, strings.Repeat("─", len(txt)))
		cautils.SimpleDisplay(os.Stderr, fmt.Sprintf("\n%s\n\n", report.message))

to

		cautils.SectionHeadingDisplay(os.Stdout, txt)
		cautils.SimpleDisplay(os.Stdout, fmt.Sprintf("%s\n\n", report.message))

which I did because that output should not be going to stderr, it should be included in the standard text output which can be redirected to stdout if needed.

So, the question is, how would you like me to change the test? There's no captureStdout to replace captureStderr, and I don't know if you know, but I'm not actually a working programmer 😉

Signed-off-by: David Wertenteil <dwertent@armosec.io>
Signed-off-by: David Wertenteil <dwertent@armosec.io>
@dwertent dwertent merged commit c9ccef9 into kubescape:master Oct 31, 2023
10 of 11 checks 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.

None yet

3 participants