(items []policyTableRow, p *policy.Policy, def *policy.Definition)
| 165 | } |
| 166 | |
| 167 | func appendFilesPolicyValue(items []policyTableRow, p *policy.Policy, def *policy.Definition) []policyTableRow { |
| 168 | items = append(items, |
| 169 | policyTableRow{"Files policy:", "", ""}, |
| 170 | policyTableRow{ |
| 171 | " Ignore cache directories:", |
| 172 | boolToString(p.FilesPolicy.IgnoreCacheDirectories.OrDefault(true)), |
| 173 | definitionPointToString(p.Target(), def.FilesPolicy.IgnoreCacheDirectories), |
| 174 | }) |
| 175 | |
| 176 | if len(p.FilesPolicy.IgnoreRules) > 0 { |
| 177 | items = append(items, policyTableRow{ |
| 178 | " Ignore rules:", "", definitionPointToString(p.Target(), def.FilesPolicy.IgnoreRules), |
| 179 | }) |
| 180 | for _, rule := range p.FilesPolicy.IgnoreRules { |
| 181 | items = append(items, policyTableRow{" " + rule, "", ""}) |
| 182 | } |
| 183 | } else { |
| 184 | items = append(items, policyTableRow{" No ignore rules:", "", ""}) |
| 185 | } |
| 186 | |
| 187 | if len(p.FilesPolicy.DotIgnoreFiles) > 0 { |
| 188 | items = append(items, policyTableRow{ |
| 189 | " Read ignore rules from files:", "", |
| 190 | definitionPointToString(p.Target(), def.FilesPolicy.DotIgnoreFiles), |
| 191 | }) |
| 192 | |
| 193 | for _, dotFile := range p.FilesPolicy.DotIgnoreFiles { |
| 194 | items = append(items, policyTableRow{" " + dotFile, "", ""}) |
| 195 | } |
| 196 | } |
| 197 | |
| 198 | if maxSize := p.FilesPolicy.MaxFileSize; maxSize > 0 { |
| 199 | items = append(items, policyTableRow{ |
| 200 | " Ignore files above:", |
| 201 | units.BytesString(maxSize), |
| 202 | definitionPointToString(p.Target(), def.FilesPolicy.MaxFileSize), |
| 203 | }) |
| 204 | } |
| 205 | |
| 206 | items = append(items, policyTableRow{ |
| 207 | " Scan one filesystem only:", |
| 208 | boolToString(p.FilesPolicy.OneFileSystem.OrDefault(false)), |
| 209 | definitionPointToString(p.Target(), def.FilesPolicy.OneFileSystem), |
| 210 | }) |
| 211 | |
| 212 | return items |
| 213 | } |
| 214 | |
| 215 | func appendErrorHandlingPolicyRows(rows []policyTableRow, p *policy.Policy, def *policy.Definition) []policyTableRow { |
| 216 | return append(rows, |
no test coverage detected