Skip to content

Commit

Permalink
Correct minor typos in variables / comments (#1356)
Browse files Browse the repository at this point in the history
Nothing user impacting here. Just some minor cleanup

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Jul 8, 2024
1 parent 1b2061b commit 005f560
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion cli/components/advisories/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func findVulnerablePackageWithoutNamespace(advisory *mvd.Advisory, installedPkg
for i := range advisory.Fixed {
if advisory.Fixed[i].Name == installedPkg.Name || advisory.Fixed[i].Name == installedPkg.Origin {
// This currently works under the assumption, that the highest version is the last one in the list
// To not re-apply all the version comparison here, we ensure the orderning in the upstream data
// To not re-apply all the version comparison here, we ensure the ordering in the upstream data
match = advisory.Fixed[i]
}
}
Expand Down
2 changes: 1 addition & 1 deletion cli/components/barchart.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (m BarChart) Render(datapoints []float64, colorMap []termenv.Color, labels

boxWidth := m.width

// if its rendered with a box, we need to substract two char from each end
// if its rendered with a box, we need to subtract two char from each end
if m.border {
boxWidth = boxWidth - 4
}
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func printScore(score *policy.Score, mrn string, out iox.OutputHelper, prefix st
return true
}

// asssetPrintable is a snapshot of the fields that get exported
// assetPrintable is a snapshot of the fields that get exported
// when doing things like JSON output
type assetPrintable struct {
Mrn string `protobuf:"bytes,1,opt,name=mrn,proto3" json:"mrn,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/json_vuln_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestJsonConverter(t *testing.T) {

buf := bytes.Buffer{}
writer := iox.IOWriter{Writer: &buf}
err = VulnReportToJSON("index.docker.io/ubutnu:focal-20220113", report, &writer)
err = VulnReportToJSON("index.docker.io/ubuntu:focal-20220113", report, &writer)
require.NoError(t, err)

assert.Contains(t, buf.String(), "\"cves\":[\"CVE-2021-43618\"]")
Expand Down
2 changes: 1 addition & 1 deletion cli/reporter/render_advisory_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ func RenderVulnerabilityStats(vulnReport *mvd.VulnReport) string {
(float64(stats.Advisories.None) / float64(total)),
}

// only add unknown if it really happend
// only add unknown if it really happened
if vulnReport.Stats.Advisories.Unknown > 0 {
colorMap = append(colorMap, colors.DefaultColorTheme.Unknown)
labels = append(labels, "Unknown")
Expand Down
2 changes: 1 addition & 1 deletion internal/datalakes/inmemory/policyhub.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (db *Db) setPolicy(ctx context.Context, policyObj *policy.Policy, filters [
var err error

// we may use the cached parents if this policy already exists i.e. if it's
// alrady referenced by others
// already referenced by others
parents := map[string]struct{}{}

x, exists := db.cache.Get(dbIDPolicy + policyObj.Mrn)
Expand Down
2 changes: 1 addition & 1 deletion policy/executor/internal/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ func (nodeData *ExecutionQueryNodeData) recalculate() *envelope {
nodeData.run()
}

// An empty evelope notifies the parent. These nodes always point at
// An empty envelope notifies the parent. These nodes always point at
// Datapoint nodes. The datapoint nodes don't need this message, and
// it actually makes more work for the datapoint node. The reason to
// send it is to uphold the contract of if something changes, we push
Expand Down
4 changes: 2 additions & 2 deletions policy/executor/internal/nodes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ func TestExecutionQueryNode(t *testing.T) {
assert.Nil(t, data)
select {
case <-q:
assert.Fail(t, "not ready for exectuion")
assert.Fail(t, "not ready for execution")
default:
}
})
Expand Down Expand Up @@ -305,7 +305,7 @@ func TestExecutionQueryNode(t *testing.T) {

select {
case <-q:
assert.Fail(t, "not ready for exectuion")
assert.Fail(t, "not ready for execution")
default:
}
})
Expand Down
4 changes: 2 additions & 2 deletions policy/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ func (s *LocalServices) jobsToFrameworksInner(cache *frameworkResolverCache, res

if _, exist := parent.ChildJobs[reportingJob.Uuid]; !exist {
// If we already have a child job, we don't need to do anything
// In the case that its a space or asset, we defiently don't want to
// In the case that its a space or asset, we definitely don't want to
// overwrite it as that would change the scoring system
impact := &explorer.Impact{}
if parent.Type == ReportingJob_FRAMEWORK {
Expand Down Expand Up @@ -1703,7 +1703,7 @@ func (s *LocalServices) jobsToControls(cache *frameworkResolverCache, framework
continue
}
execQuery := cache.executionQueries[mquery.Checksum]
// the data query may be part of the bundle, but it may not match the curent asset,
// the data query may be part of the bundle, but it may not match the current asset,
// which means it will not be part of the execution
if execQuery == nil {
continue
Expand Down
6 changes: 3 additions & 3 deletions policy/resolver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -597,10 +597,10 @@ framework_maps:
controls:
- uid: control4
controls:
- uid: control1
- uid: control1
- uid: control5
controls:
- uid: control1
- uid: control1
`

t.Run("resolve with correct filters", func(t *testing.T) {
Expand Down Expand Up @@ -695,7 +695,7 @@ framework_maps:

t.Run("test resolving with inactive data queries", func(t *testing.T) {
// test that creating a bundle with inactive data queries (where the packs/policies are inactive)
// will still end up in a succesfully resolved policy for the asset
// will still end up in a successfully resolved policy for the asset
bundleStr := `
owner_mrn: //test.sth
policies:
Expand Down
6 changes: 3 additions & 3 deletions upstream/gql.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ func SearchPolicy(
ctx context.Context,
c *gql.MondooClient,
scopeMrn string,
assingedOnly,
assignedOnly,
includePublic,
includePrivate *bool,
) ([]*UpstreamPolicy, error) {
Expand All @@ -56,8 +56,8 @@ func SearchPolicy(
ScopeMrn: mondoogql.String(scopeMrn),
CatalogType: mondoogql.CatalogType("POLICY"),
}
if assingedOnly != nil {
input.AssignedOnly = mondoogql.NewBooleanPtr(mondoogql.Boolean(*assingedOnly))
if assignedOnly != nil {
input.AssignedOnly = mondoogql.NewBooleanPtr(mondoogql.Boolean(*assignedOnly))
}
if includePublic != nil {
input.IncludePublic = mondoogql.NewBooleanPtr(mondoogql.Boolean(*includePublic))
Expand Down

0 comments on commit 005f560

Please sign in to comment.