Fix lint issues: lll linter (#486)

This commit is contained in:
Chris McGehee 2021-05-22 10:29:18 -07:00 committed by GitHub
parent 50f7ed8519
commit 35fece6491
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 5 deletions

View File

@ -36,7 +36,7 @@ linters:
- gosimple
- govet
- ineffassign
# - lll
- lll
- misspell
- nakedret
- nestif

View File

@ -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)
}