Skip to content

Commit

Permalink
feat: remove useless it/s information in progressbar
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski committed Oct 11, 2023
1 parent 6f6e6b9 commit 6130dfc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/commands/process/orchestrator/orchestrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (orchestrator *Orchestrator) Scan(
}

func (orchestrator *Orchestrator) waitForScan(fileComplete chan struct{}, totalCount int) {
progressBar := bearerprogress.GetProgressBar(totalCount, orchestrator.config, "files")
progressBar := bearerprogress.GetProgressBar(totalCount, orchestrator.config)
count := 0

defer func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/report/output/privacy/privacy.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func AddReportData(reportData *outputtypes.ReportData, config settings.Config) e
output.StdErrLog("Evaluating rules")
}

bar := progressbar.GetProgressBar(len(config.Rules), config, "rules")
bar := progressbar.GetProgressBar(len(config.Rules), config)

subjectRuleFailures := make(map[string]RuleFailureSummary)
thirdPartyRuleFailures := make(map[string]map[string]RuleFailureSummary)
Expand Down
2 changes: 1 addition & 1 deletion internal/report/output/security/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func evaluateRules(

var bar *progressbar.ProgressBar
if !builtIn {
bar = bearerprogressbar.GetProgressBar(len(rules), config, "rules")
bar = bearerprogressbar.GetProgressBar(len(rules), config)
}

var fingerprints []string
Expand Down
4 changes: 1 addition & 3 deletions internal/util/progressbar/progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/schollz/progressbar/v3"
)

func GetProgressBar(filesLength int, config settings.Config, display_type string) *progressbar.ProgressBar {
func GetProgressBar(filesLength int, config settings.Config) *progressbar.ProgressBar {
hideProgress := config.Scan.HideProgressBar || config.Scan.Quiet || config.Debug
return progressbar.NewOptions(filesLength,
progressbar.OptionSetVisibility(!hideProgress),
Expand All @@ -18,8 +18,6 @@ func GetProgressBar(filesLength int, config settings.Config, display_type string
progressbar.OptionOnCompletion(func() {
output.ErrorWriter().Write([]byte("\n")) //nolint:all,errcheck
}),
progressbar.OptionShowIts(),
progressbar.OptionSetItsString(display_type),
progressbar.OptionSetDescription(" └"),
progressbar.OptionSetTheme(progressbar.Theme{
Saucer: "=",
Expand Down

0 comments on commit 6130dfc

Please sign in to comment.