IsSkipFile returns true if a skip-file directive applies to the given rule. Unlike IsSuppressed, this only considers true file-level skip-file directives.
(ruleName string)
| 233 | // IsSkipFile returns true if a skip-file directive applies to the given rule. |
| 234 | // Unlike IsSuppressed, this only considers true file-level skip-file directives. |
| 235 | func (ds *DirectiveSet) IsSkipFile(ruleName string) bool { |
| 236 | ruleLower := strings.ToLower(ruleName) |
| 237 | for _, rs := range ds.fileLevel { |
| 238 | ruleNameLower := strings.ToLower(rs.Rule) |
| 239 | if ruleNameLower == ruleLower || ruleNameLower == "*" { |
| 240 | return true |
| 241 | } |
| 242 | } |
| 243 | return false |
| 244 | } |
| 245 | |
| 246 | // GetEffectiveSeverityAndMarkUsed returns the effective severity and marks the directive as used |
| 247 | // if it affected the result. This is used to track unused directives for warnings. |
no outgoing calls