mirror of
https://github.com/ossf/scorecard.git
synced 2024-09-11 08:55:27 +03:00
Fix lint issues: lll linter (#486)
This commit is contained in:
parent
50f7ed8519
commit
35fece6491
@ -36,7 +36,7 @@ linters:
|
|||||||
- gosimple
|
- gosimple
|
||||||
- govet
|
- govet
|
||||||
- ineffassign
|
- ineffassign
|
||||||
# - lll
|
- lll
|
||||||
- misspell
|
- misspell
|
||||||
- nakedret
|
- nakedret
|
||||||
- nestif
|
- nestif
|
||||||
|
@ -29,13 +29,14 @@ func init() {
|
|||||||
|
|
||||||
func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
||||||
// check repository for repository-specific policy
|
// check repository for repository-specific policy
|
||||||
result := CheckIfFileExists(securityPolicyStr, c, func(name string, logf func(s string, f ...interface{})) (bool, error) {
|
onFile := func(name string, logf func(s string, f ...interface{})) (bool, error) {
|
||||||
if strings.EqualFold(name, "security.md") {
|
if strings.EqualFold(name, "security.md") {
|
||||||
logf("security policy : %s", name)
|
logf("security policy : %s", name)
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
}
|
||||||
|
result := CheckIfFileExists(securityPolicyStr, c, onFile)
|
||||||
|
|
||||||
if result.Pass {
|
if result.Pass {
|
||||||
return result
|
return result
|
||||||
@ -46,11 +47,12 @@ func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
|||||||
dotGitHub := c
|
dotGitHub := c
|
||||||
dotGitHub.Repo = ".github"
|
dotGitHub.Repo = ".github"
|
||||||
|
|
||||||
return CheckIfFileExists(securityPolicyStr, dotGitHub, func(name string, logf func(s string, f ...interface{})) (bool, error) {
|
onFile = func(name string, logf func(s string, f ...interface{})) (bool, error) {
|
||||||
if strings.EqualFold(name, "security.md") {
|
if strings.EqualFold(name, "security.md") {
|
||||||
logf("security policy within .github folder : %s", name)
|
logf("security policy within .github folder : %s", name)
|
||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
})
|
}
|
||||||
|
return CheckIfFileExists(securityPolicyStr, dotGitHub, onFile)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user