Skip to content

Commit

Permalink
spelling: workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Josh Soref <[email protected]>
  • Loading branch information
jsoref committed Jan 18, 2024
1 parent be2d03e commit fe9cf40
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 39 deletions.
10 changes: 5 additions & 5 deletions checks/evaluation/pinned_dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type pinnedResult struct {

// Structure to host information about pinned github
// or third party dependencies.
type worklowPinningResult struct {
type workflowPinningResult struct {
thirdParties pinnedResult
gitHubOwned pinnedResult
}
Expand Down Expand Up @@ -209,7 +209,7 @@ func PinningDependencies(name string, c *checker.CheckRequest,
return checker.CreateRuntimeErrorResult(name, e)
}

var wp worklowPinningResult
var wp workflowPinningResult
pr := make(map[checker.DependencyUseType]pinnedResult)
dl := c.Dlogger

Expand Down Expand Up @@ -300,7 +300,7 @@ func PinningDependencies(name string, c *checker.CheckRequest,

func updatePinningResults(dependencyType checker.DependencyUseType,
outcome finding.Outcome, snippet *string,
wp *worklowPinningResult, pr map[checker.DependencyUseType]pinnedResult,
wp *workflowPinningResult, pr map[checker.DependencyUseType]pinnedResult,
) {
if dependencyType == checker.DependencyUseTypeGHAction {
// Note: `Snippet` contains `action/name@xxx`, so we can use it to infer
Expand Down Expand Up @@ -345,7 +345,7 @@ func addPinnedResult(outcome finding.Outcome, r *pinnedResult) {
r.total += 1
}

func addWorkflowPinnedResult(outcome finding.Outcome, w *worklowPinningResult, isGitHub bool) {
func addWorkflowPinnedResult(outcome finding.Outcome, w *workflowPinningResult, isGitHub bool) {
if isGitHub {
addPinnedResult(outcome, &w.gitHubOwned)
} else {
Expand All @@ -359,7 +359,7 @@ func logPinnedResult(dl checker.DetailLogger, p pinnedResult, name string) {
})
}

func createScoreForGitHubActionsWorkflow(wp *worklowPinningResult, dl checker.DetailLogger,
func createScoreForGitHubActionsWorkflow(wp *workflowPinningResult, dl checker.DetailLogger,
) []checker.ProportionalScoreWeighted {
if wp.gitHubOwned.total == 0 && wp.thirdParties.total == 0 {
return []checker.ProportionalScoreWeighted{}
Expand Down
66 changes: 33 additions & 33 deletions checks/evaluation/pinned_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
//nolint:govet
tests := []struct {
name string
r worklowPinningResult
r workflowPinningResult
scores []checker.ProportionalScoreWeighted
}{
{
name: "GitHub-owned and Third-Party actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 1,
total: 1,
Expand All @@ -60,7 +60,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "only GitHub-owned actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 1,
total: 1,
Expand All @@ -85,7 +85,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "only Third-Party actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 0,
total: 1,
Expand All @@ -110,7 +110,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "no GitHub actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 0,
total: 1,
Expand All @@ -135,7 +135,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "no GitHub-owned actions and Third-party actions unpinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -155,7 +155,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "no Third-party actions and GitHub-owned actions unpinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 0,
total: 1,
Expand All @@ -175,7 +175,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "no GitHub-owned actions and Third-party actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -195,7 +195,7 @@ func Test_createScoreForGitHubActionsWorkflow(t *testing.T) {
},
{
name: "no Third-party actions and GitHub-owned actions pinned",
r: worklowPinningResult{
r: workflowPinningResult{
gitHubOwned: pinnedResult{
pinned: 1,
total: 1,
Expand Down Expand Up @@ -884,23 +884,23 @@ func Test_generateOwnerToDisplay(t *testing.T) {
func Test_addWorkflowPinnedResult(t *testing.T) {
t.Parallel()
type args struct {
w *worklowPinningResult
w *workflowPinningResult
outcome finding.Outcome
isGitHub bool
}
tests := []struct {
name string
want *worklowPinningResult
want *workflowPinningResult
args args
}{
{
name: "add pinned GitHub-owned action dependency",
args: args{
outcome: finding.OutcomePositive,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
isGitHub: true,
},
want: &worklowPinningResult{
want: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -915,10 +915,10 @@ func Test_addWorkflowPinnedResult(t *testing.T) {
name: "add unpinned GitHub-owned action dependency",
args: args{
outcome: finding.OutcomeNegative,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
isGitHub: true,
},
want: &worklowPinningResult{
want: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -933,10 +933,10 @@ func Test_addWorkflowPinnedResult(t *testing.T) {
name: "add pinned Third-Party action dependency",
args: args{
outcome: finding.OutcomePositive,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
isGitHub: false,
},
want: &worklowPinningResult{
want: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 1,
total: 1,
Expand All @@ -951,10 +951,10 @@ func Test_addWorkflowPinnedResult(t *testing.T) {
name: "add unpinned Third-Party action dependency",
args: args{
outcome: finding.OutcomeNegative,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
isGitHub: false,
},
want: &worklowPinningResult{
want: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 1,
Expand Down Expand Up @@ -1032,13 +1032,13 @@ func TestUpdatePinningResults(t *testing.T) {
t.Parallel()
type args struct {
snippet *string
w *worklowPinningResult
w *workflowPinningResult
pr map[checker.DependencyUseType]pinnedResult
dependencyType checker.DependencyUseType
outcome finding.Outcome
}
type want struct {
w *worklowPinningResult
w *workflowPinningResult
pr map[checker.DependencyUseType]pinnedResult
}
tests := []struct { //nolint:govet
Expand All @@ -1052,11 +1052,11 @@ func TestUpdatePinningResults(t *testing.T) {
dependencyType: checker.DependencyUseTypeGHAction,
outcome: finding.OutcomePositive,
snippet: stringAsPointer("actions/checkout@a81bbbf8298c0fa03ea29cdc473d45769f953675"),
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{
w: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -1075,11 +1075,11 @@ func TestUpdatePinningResults(t *testing.T) {
dependencyType: checker.DependencyUseTypeGHAction,
outcome: finding.OutcomeNegative,
snippet: stringAsPointer("actions/checkout@v2"),
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{
w: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 0,
Expand All @@ -1097,12 +1097,12 @@ func TestUpdatePinningResults(t *testing.T) {
args: args{
dependencyType: checker.DependencyUseTypeGHAction,
outcome: finding.OutcomePositive,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
snippet: stringAsPointer("other/checkout@ffa6706ff2127a749973072756f83c532e43ed02"),
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{
w: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 1,
total: 1,
Expand All @@ -1121,11 +1121,11 @@ func TestUpdatePinningResults(t *testing.T) {
dependencyType: checker.DependencyUseTypeGHAction,
snippet: stringAsPointer("other/checkout@v2"),
outcome: finding.OutcomeNegative,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{
w: &workflowPinningResult{
thirdParties: pinnedResult{
pinned: 0,
total: 1,
Expand All @@ -1143,11 +1143,11 @@ func TestUpdatePinningResults(t *testing.T) {
args: args{
dependencyType: checker.DependencyUseTypePipCommand,
outcome: finding.OutcomePositive,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: map[checker.DependencyUseType]pinnedResult{
checker.DependencyUseTypePipCommand: {
pinned: 1,
Expand All @@ -1161,11 +1161,11 @@ func TestUpdatePinningResults(t *testing.T) {
args: args{
dependencyType: checker.DependencyUseTypePipCommand,
outcome: finding.OutcomeNegative,
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: make(map[checker.DependencyUseType]pinnedResult),
},
want: want{
w: &worklowPinningResult{},
w: &workflowPinningResult{},
pr: map[checker.DependencyUseType]pinnedResult{
checker.DependencyUseTypePipCommand: {
pinned: 0,
Expand Down
2 changes: 1 addition & 1 deletion checks/raw/pinned_dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ func TestShellScriptDownloadPinned(t *testing.T) {
}
}

func TestGitHubWorflowRunDownload(t *testing.T) {
func TestGitHubWorkflowRunDownload(t *testing.T) {
t.Parallel()
//nolint:govet
tests := []struct {
Expand Down

0 comments on commit fe9cf40

Please sign in to comment.