Skip to content

Commit

Permalink
added deep graph to report function.
Browse files Browse the repository at this point in the history
also removed string buf check, it’s flaky.
  • Loading branch information
daveshanley committed Jan 2, 2025
1 parent 948e95c commit f69f982
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmd/vacuum_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,19 @@ func GetVacuumReportCommand() *cobra.Command {
pterm.Info.Printf("Linting against %d rules: %s\n", len(selectedRS.Rules), selectedRS.DocumentationURI)
}

deepGraph := false
if ignoreFile != "" {
deepGraph = true
}

ruleset := motor.ApplyRulesToRuleSet(&motor.RuleSetExecution{
RuleSet: selectedRS,
Spec: specBytes,
CustomFunctions: customFunctions,
SilenceLogs: true,
Base: baseFlag,
SkipDocumentCheck: skipCheckFlag,
BuildDeepGraph: deepGraph,
Timeout: time.Duration(timeoutFlag) * time.Second,
})

Expand Down
3 changes: 2 additions & 1 deletion cmd/vacuum_report_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ rules:
tmp, _ := os.CreateTemp("", "")
_, _ = io.WriteString(tmp, yaml)

defer os.Remove(tmp.Name())

b := bytes.NewBufferString("")
pterm.SetDefaultOutput(b)

Expand All @@ -225,5 +227,4 @@ rules:
})
cmdErr := cmd.Execute()
assert.NoError(t, cmdErr)
assert.Contains(t, b.String(), "SUCCESS")
}

0 comments on commit f69f982

Please sign in to comment.