-
Notifications
You must be signed in to change notification settings - Fork 31
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
Feature/improve output #516
Conversation
4c516a6
to
4dd5d3d
Compare
4dd5d3d
to
98d17f3
Compare
@@ -70,14 +70,15 @@ func (p *Printer) StartPP(g *graph.Graph) (pp.Renderable, error) { | |||
|
|||
// FinishPP provides summary statistics about the printed graph | |||
func (p *Printer) FinishPP(g *graph.Graph) (pp.Renderable, error) { | |||
tmpl, err := p.template("{{if gt (len .Errors) 0}}{{red \"Summary\"}}{{else}}{{green \"Summary\"}}{{end}}: {{len .Errors}} errors, {{.ChangesCount}} changes{{if .Errors}}\n{{range .Errors}}\n * {{.}}{{end}}{{end}}\n") | |||
tmpl, err := p.template("{{if .Errors}}Errors:\n{{range .Errors}} * {{.}}\n{{end}}\n{{end}}{{if .DependencyErrors}}Failed due to failing dependency:\n{{range .DependencyErrors}} * {{.}}\n{{end}}\n{{end}}{{if gt (len .Errors) 0}}{{red \"Summary\"}}{{else}}{{green \"Summary\"}}{{end}}: {{len .Errors}} errors, {{.ChangesCount}} changes{{if .DependencyErrors}}, {{len .DependencyErrors}} dependency errors{{end}}\n") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be more readable if this were broken up into multiple lines as long as that doesn't break anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid newlines by putting a - before or after braces. {{- .}}
would print the dot value and trim all whitespace characters before, {{. -}}
would do the same but after. You do both, too. :)
What does the output look like now? Does this need to update the docs with the new format? |
Output is unchanged if there are no errors or dependency errors. With this PR we draw the nodes that have changes, then once we encounter an error we draw that node; any nodes that depend on that failed node are not drawn (and are no longer counted as changes either). Here is sample output of running Here we have only an error:
The next two are sample output with both errors and dependency errors:
|
e056633
to
decedd3
Compare
decedd3
to
0211fd3
Compare
Improve output, specifically errors/cascading errors due to an error in a dependency.
Changes:
Fixes #367