Skip to content

Commit

Permalink
feat: add more details to 'have_permission' rule message
Browse files Browse the repository at this point in the history
  • Loading branch information
omissis committed Sep 11, 2022
1 parent 5767729 commit 6fe84c1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/arch/file/expect/have_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ func (e havePermissionsExpression) getViolation(filePath string) rule.CoreViolat
iNodeType = "directory"
}

format := "%s '%s' does not have permissions matching '%s'"
format := "%s '%s' does not have permissions matching '%s', '%s' found"

if e.options.negated {
format = "%s '%s' does have permissions matching '%s'"
format = "%s '%s' does have permissions matching '%s', '%s' found"
}

return rule.NewCoreViolation(
fmt.Sprintf(format, iNodeType, filepath.Base(filePath), e.permissions),
fmt.Sprintf(format, iNodeType, filepath.Base(filePath), e.permissions, info.Mode().String()),
)
}

0 comments on commit 6fe84c1

Please # to comment.