Skip to content

Commit

Permalink
docs(branch-protection): add TODO comments pointing refactor opportun…
Browse files Browse the repository at this point in the history
…ities

Signed-off-by: Diogo Teles Sant'Anna <[email protected]>
  • Loading branch information
diogoteles08 committed Nov 21, 2023
1 parent 8be4fe5 commit 00ddeb0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions checks/evaluation/branch_protection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func testScore(branch *clients.BranchRef, codeownersFiles []string, dl checker.D
return computeFinalScore([]levelScore{score}, dl)
}

// TODO: order of tests to have progressive scores.
func TestIsBranchProtected(t *testing.T) {
t.Parallel()
trueVal := true
Expand All @@ -49,6 +50,7 @@ func TestIsBranchProtected(t *testing.T) {
expected scut.TestReturn
}{
{
// TODO: Naming is inconsistent. We should change this to make it score 0.
name: "Nothing is enabled",
expected: scut.TestReturn{
Error: nil,
Expand Down
1 change: 1 addition & 0 deletions clients/githubrepo/branches.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ func (handler *branchesHandler) getBranch(branch string) (*clients.BranchRef, er
return branchRef, nil
}

// TODO: Move these two functions to below the GetBranchRefFrom functions, the single place they're used.
func copyAdminSettings(src *branchProtectionRule, dst *clients.BranchProtectionRule) {
copyBoolPtr(src.IsAdminEnforced, &dst.EnforceAdmins)
copyBoolPtr(src.RequireLastPushApproval, &dst.RequireLastPushApproval)
Expand Down

0 comments on commit 00ddeb0

Please sign in to comment.