Skip to content

Commit

Permalink
Merge branch 'main' into bug/wp
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsimon authored Feb 2, 2022
2 parents 91c7c2c + 79b216c commit a3e74a0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 2 deletions.
10 changes: 8 additions & 2 deletions checks/raw/security_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,10 @@ func SecurityPolicy(c *checker.CheckRequest) (checker.SecurityPolicyData, error)
}
if strings.EqualFold(name, "security.md") ||
strings.EqualFold(name, ".github/security.md") ||
strings.EqualFold(name, "docs/security.md") {
strings.EqualFold(name, "docs/security.md") ||
strings.EqualFold(name, "security.adoc") ||
strings.EqualFold(name, ".github/security.adoc") ||
strings.EqualFold(name, "docs/security.adoc") {
*pfiles = append(*pfiles, checker.File{
Path: name,
Type: checker.FileTypeSource,
Expand Down Expand Up @@ -89,7 +92,10 @@ func SecurityPolicy(c *checker.CheckRequest) (checker.SecurityPolicyData, error)
}
if strings.EqualFold(name, "security.md") ||
strings.EqualFold(name, ".github/security.md") ||
strings.EqualFold(name, "docs/security.md") {
strings.EqualFold(name, "docs/security.md") ||
strings.EqualFold(name, "security.adoc") ||
strings.EqualFold(name, ".github/security.adoc") ||
strings.EqualFold(name, "docs/security.adoc") {
*pfiles = append(*pfiles, checker.File{
Path: name,
Type: checker.FileTypeURL,
Expand Down
30 changes: 30 additions & 0 deletions checks/security_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,36 @@ func TestSecurityPolicy(t *testing.T) {
NumberOfInfo: 1,
},
},
{
name: "security.adoc",
files: []string{
"security.adoc",
},
want: scut.TestReturn{
Score: 10,
NumberOfInfo: 1,
},
},
{
name: ".github/security.adoc",
files: []string{
".github/security.adoc",
},
want: scut.TestReturn{
Score: 10,
NumberOfInfo: 1,
},
},
{
name: "docs/security.adoc",
files: []string{
"docs/security.adoc",
},
want: scut.TestReturn{
Score: 10,
NumberOfInfo: 1,
},
},
}
for _, tt := range tests {
tt := tt
Expand Down

0 comments on commit a3e74a0

Please sign in to comment.