List Analyzer rules in an independent section in the rule directory (#4664)
This commit is contained in:
parent
d6ff2a7f37
commit
68dc0f58d2
|
@ -22,6 +22,10 @@
|
|||
[jimmya](https://github.com/jimmya)
|
||||
[#issue_number](https://github.com/realm/SwiftLint/issues/4609)
|
||||
|
||||
* Separate analyzer rules as an independent section in the rule directory of the reference.
|
||||
[Ethan Wong](https://github.com/GetToSet)
|
||||
[#4664](https://github.com/realm/SwiftLint/pull/4664)
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* Report violations in all `<scope>_length` rules when the error threshold is
|
||||
|
|
|
@ -34,7 +34,8 @@ public struct RuleListDocumentation {
|
|||
|
||||
private var indexContents: String {
|
||||
let defaultRuleDocumentations = ruleDocumentations.filter { !$0.isOptInRule }
|
||||
let optInRuleDocumentations = ruleDocumentations.filter { $0.isOptInRule }
|
||||
let optInRuleDocumentations = ruleDocumentations.filter { $0.isOptInRule && !$0.isAnalyzerRule }
|
||||
let analyzerRuleDocumentations = ruleDocumentations.filter { $0.isAnalyzerRule }
|
||||
|
||||
return """
|
||||
# Rule Directory
|
||||
|
@ -51,6 +52,12 @@ public struct RuleListDocumentation {
|
|||
.map { "* `\($0.ruleIdentifier)`: \($0.ruleName)" }
|
||||
.joined(separator: "\n"))
|
||||
|
||||
## Analyzer Rules
|
||||
|
||||
\(analyzerRuleDocumentations
|
||||
.map { "* `\($0.ruleIdentifier)`: \($0.ruleName)" }
|
||||
.joined(separator: "\n"))
|
||||
|
||||
"""
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue