Fixed display of optin and correctable (#4841)
Co-authored-by: Martin Redington <mildm8nnered@gmail.com>
This commit is contained in:
parent
efc5afd5d5
commit
5a91b1e392
|
@ -70,8 +70,8 @@ private extension TextTable {
|
|||
|
||||
addRow(values: [
|
||||
ruleIdentifier,
|
||||
rule is OptInRule ? "yes" : "no",
|
||||
rule is CorrectableRule ? "yes" : "no",
|
||||
rule is OptInRule.Type ? "yes" : "no",
|
||||
rule is CorrectableRule.Type ? "yes" : "no",
|
||||
rule == nil ? "yes" : "no",
|
||||
numberOfWarnings.formattedString.leftPadded(forHeader: numberOfWarningsHeader),
|
||||
numberOfErrors.formattedString.leftPadded(forHeader: numberOfErrorsHeader),
|
||||
|
|
|
@ -160,7 +160,12 @@ class ReporterTests: XCTestCase {
|
|||
func testSummaryReporter() {
|
||||
let expectedOutput = stringFromFile("CannedSummaryReporterOutput.txt")
|
||||
.trimmingTrailingCharacters(in: .whitespacesAndNewlines)
|
||||
let result = SummaryReporter.generateReport(generateViolations())
|
||||
let correctableViolation = StyleViolation(
|
||||
ruleDescription: VerticalWhitespaceOpeningBracesRule.description,
|
||||
location: Location(file: "filename", line: 1, character: 2),
|
||||
reason: "Violation Reason"
|
||||
)
|
||||
let result = SummaryReporter.generateReport(generateViolations() + [correctableViolation])
|
||||
XCTAssertEqual(result, expectedOutput)
|
||||
}
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
+-----------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| rule identifier | opt-in | correctable | custom | warnings | errors | total violations | number of files |
|
||||
+-----------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| line_length | no | no | no | 1 | 1 | 2 | 1 |
|
||||
| colon | no | no | no | 0 | 1 | 1 | 1 |
|
||||
| syntactic_sugar | no | no | no | 0 | 1 | 1 | 1 |
|
||||
+-----------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| Total | | | | 1 | 3 | 4 | 2 |
|
||||
+-----------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
+------------------------------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| rule identifier | opt-in | correctable | custom | warnings | errors | total violations | number of files |
|
||||
+------------------------------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| line_length | no | no | no | 1 | 1 | 2 | 1 |
|
||||
| colon | no | yes | no | 0 | 1 | 1 | 1 |
|
||||
| syntactic_sugar | no | yes | no | 0 | 1 | 1 | 1 |
|
||||
| vertical_whitespace_opening_braces | yes | yes | no | 1 | 0 | 1 | 1 |
|
||||
+------------------------------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
| Total | | | | 2 | 3 | 5 | 2 |
|
||||
+------------------------------------+--------+-------------+--------+----------+--------+------------------+-----------------+
|
||||
|
|
Loading…
Reference in New Issue