Skip to content

Commit 7857e04

Browse files
Ratan KumarRatan Kumar
Ratan Kumar
authored and
Ratan Kumar
committed
adds yaml support
1 parent 026dc41 commit 7857e04

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

pkg/scorecard/scorecard.go

+8-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,14 @@ func runScorecard(ctx context.Context,
201201

202202
func findConfigFile(rc clients.RepoClient) (io.ReadCloser, string) {
203203
// Look for a config file. Return first one regardless of validity
204-
locs := []string{"scorecard.yml", ".scorecard.yml", ".github/scorecard.yml"}
204+
locs := []string{
205+
"scorecard.yml",
206+
"scorecard.yaml",
207+
".scorecard.yml",
208+
".scorecard.yaml",
209+
".github/scorecard.yml",
210+
".github/scorecard.yaml",
211+
}
205212

206213
for i := range locs {
207214
cfr, err := rc.GetFileReader(locs[i])

pkg/scorecard/scorecard_test.go

+19-1
Original file line numberDiff line numberDiff line change
@@ -365,21 +365,39 @@ func Test_findConfigFile(t *testing.T) {
365365
found: "scorecard.yml",
366366
wantFound: true,
367367
},
368+
{
369+
desc: "scorecard.yaml exists",
370+
locs: []string{"scorecard.yaml"},
371+
found: "scorecard.yaml",
372+
wantFound: true,
373+
},
368374
{
369375
desc: ".scorecard.yml exists",
370376
locs: []string{".scorecard.yml"},
371377
found: ".scorecard.yml",
372378
wantFound: true,
373379
},
380+
{
381+
desc: ".scorecard.yaml exists",
382+
locs: []string{".scorecard.yaml"},
383+
found: ".scorecard.yaml",
384+
wantFound: true,
385+
},
374386
{
375387
desc: ".github/scorecard.yml exists",
376388
locs: []string{".github/scorecard.yml"},
377389
found: ".github/scorecard.yml",
378390
wantFound: true,
379391
},
392+
{
393+
desc: ".github/scorecard.yaml exists",
394+
locs: []string{".github/scorecard.yaml"},
395+
found: ".github/scorecard.yaml",
396+
wantFound: true,
397+
},
380398
{
381399
desc: "multiple configs exist",
382-
locs: []string{"scorecard.yml", ".github/scorecard.yml"},
400+
locs: []string{"scorecard.yml", ".github/scorecard.yaml"},
383401
found: "scorecard.yml",
384402
wantFound: true,
385403
},

0 commit comments

Comments
 (0)