Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Glenn Lewis <[email protected]>
  • Loading branch information
ysoldak and gmlewis committed Jul 4, 2023
1 parent 78d5ca8 commit 3881d6f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions github/github-accessors.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions github/github-accessors_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions github/orgs_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func TestOrganizationsService_GetAllOrganizationRulesets(t *testing.T) {
})
}

func TestOrganizationsService_CreateOrganizationRulesetRepoNames(t *testing.T) {
func TestOrganizationsService_CreateOrganizationRuleset_RepoNames(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

Expand Down Expand Up @@ -392,7 +392,7 @@ func TestOrganizationsService_CreateOrganizationRulesetRepoNames(t *testing.T) {
})
}

func TestOrganizationsService_CreateOrganizationRulesetRepoIds(t *testing.T) {
func TestOrganizationsService_CreateOrganizationRuleset_RepoIDs(t *testing.T) {
client, mux, _, teardown := setup()
defer teardown()

Expand Down Expand Up @@ -541,8 +541,8 @@ func TestOrganizationsService_CreateOrganizationRulesetRepoIds(t *testing.T) {
Include: []string{"refs/heads/main", "refs/heads/master"},
Exclude: []string{"refs/heads/dev*"},
},
RepositoryId: &RulesetRepositoryIdsConditionParameters{
RepositoryIds: []int64{123, 456},
RepositoryID: &RulesetRepositoryIDsConditionParameters{
RepositoryIDs: []int64{123, 456},
},
},
Rules: []*RepositoryRule{
Expand Down Expand Up @@ -625,8 +625,8 @@ func TestOrganizationsService_CreateOrganizationRulesetRepoIds(t *testing.T) {
Include: []string{"refs/heads/main", "refs/heads/master"},
Exclude: []string{"refs/heads/dev*"},
},
RepositoryId: &RulesetRepositoryIdsConditionParameters{
RepositoryIds: []int64{123, 456},
RepositoryID: &RulesetRepositoryIDsConditionParameters{
RepositoryIDs: []int64{123, 456},
},
},
Rules: []*RepositoryRule{
Expand Down
10 changes: 5 additions & 5 deletions github/repos_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ type RulesetRepositoryNamesConditionParameters struct {
Protected *bool `json:"protected,omitempty"`
}

// RulesetRepositoryIdsConditionParameters represents the conditions object for repository_ids.
type RulesetRepositoryIdsConditionParameters struct {
RepositoryIds []int64 `json:"repository_ids,omitempty"`
// RulesetRepositoryIDsConditionParameters represents the conditions object for repository_ids.
type RulesetRepositoryIDsConditionParameters struct {
RepositoryIDs []int64 `json:"repository_ids,omitempty"`
}

// RulesetCondition represents the conditions object in a ruleset.
// Set either RepositoryName or RepositoryId, not both
// Set either RepositoryName or RepositoryID, not both.
type RulesetConditions struct {
RefName *RulesetRefConditionParameters `json:"ref_name,omitempty"`
RepositoryName *RulesetRepositoryNamesConditionParameters `json:"repository_name,omitempty"`
RepositoryId *RulesetRepositoryIdsConditionParameters `json:"repository_id,omitempty"`
RepositoryID *RulesetRepositoryIDsConditionParameters `json:"repository_id,omitempty"`
}

// RulePatternParameters represents the rule pattern parameters.
Expand Down

0 comments on commit 3881d6f

Please sign in to comment.