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
|
||||
- govet
|
||||
- ineffassign
|
||||
# - lll
|
||||
- lll
|
||||
- misspell
|
||||
- nakedret
|
||||
- nestif
|
||||
|
@ -29,13 +29,14 @@ func init() {
|
||||
|
||||
func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
||||
// 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") {
|
||||
logf("security policy : %s", name)
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
}
|
||||
result := CheckIfFileExists(securityPolicyStr, c, onFile)
|
||||
|
||||
if result.Pass {
|
||||
return result
|
||||
@ -46,11 +47,12 @@ func SecurityPolicy(c *checker.CheckRequest) checker.CheckResult {
|
||||
dotGitHub := c
|
||||
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") {
|
||||
logf("security policy within .github folder : %s", name)
|
||||
return true, nil
|
||||
}
|
||||
return false, nil
|
||||
})
|
||||
}
|
||||
return CheckIfFileExists(securityPolicyStr, dotGitHub, onFile)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user