-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vertical whitespace msg fix #1774
Vertical whitespace msg fix #1774
Conversation
Generated by 🚫 Danger |
CHANGELOG.md
Outdated
@@ -38,6 +38,23 @@ | |||
[Otávio Lima](https://github.com/otaviolima) | |||
[#1710](https://github.com/realm/SwiftLint/issues/1710) | |||
|
|||
## 0.22.0: Coffee Maker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this here?
This change should be added to Master
section.
@@ -11,6 +11,8 @@ import XCTest | |||
|
|||
class VerticalWhitespaceRuleTests: XCTestCase { | |||
|
|||
private let ruleID = "vertical_whitespace" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use VerticalWhitespaceRule.description.identifier
} | ||
} | ||
|
||
func testVilationMessageWithDefaultConfiguration() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
} | ||
let allViolations = violations("let aaaa = 0\n\n\n\nlet bbb = 2\n", config: config) | ||
let verticalWhiteSpaceViolation = allViolations.first(where: { $0.ruleDescription.identifier == ruleID }) | ||
if let violation = verticalWhiteSpaceViolation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test will silently fail if no violation is triggered. It should fail instead.
func testVilationMessageWithDefaultConfiguration() { | ||
let allViolations = violations("let aaaa = 0\n\n\n\nlet bbb = 2\n") | ||
let verticalWhiteSpaceViolation = allViolations.first(where: { $0.ruleDescription.identifier == ruleID }) | ||
if let violation = verticalWhiteSpaceViolation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this test will silently fail if no violation is triggered. It should fail instead.
for eachLine in linesSections { | ||
let start = eachLine.lastLine.index - eachLine.linesToRemove | ||
indexOfLinesToDelete.append(contentsOf: start..<eachLine.lastLine.index) | ||
for section in linesSections { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to add tests for this change as well.
CHANGELOG.md
Outdated
##### Bug Fixes | ||
|
||
* Fix the warning message of `vertical-whitespace` rule to display the maximum empty lines allowed if `maxEmptyLines` is greater than 1. | ||
* Fix the autocorrection of `vertical-whitespace` rule to keep the `maxEmptyLines` in the cleaned section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicated message
CHANGELOG.md
Outdated
##### Bug Fixes | ||
|
||
* Fix the warning message of `vertical-whitespace` rule to display the maximum empty lines allowed if `maxEmptyLines` is greater than 1. | ||
* Fix the autocorrection of `vertical-whitespace` rule to keep the `maxEmptyLines` in the cleaned section. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
requires two trailing spaces as described in CONTRIBUTING.md: https://github.com/realm/SwiftLint/blob/master/CONTRIBUTING.md#tracking-changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made some comments that need to be addressed before merging this.
Thanks, @hossamghareeb! I just did some minor changes in 7f5e236. |
Fixing issue #1763
Fixes:
maxEmptyLines
.maxEmptyLines
and not 1.