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

"mark" rule's autocorrections are eating preceding closing braces #1029

Closed
ChristopherRogers opened this Issue Dec 22, 2016 · 5 comments

Comments

Projects
None yet
4 participants
@ChristopherRogers

ChristopherRogers commented Dec 22, 2016

EDIT: This bug should now be reproducible with the code snippet below as of 0.16.1.

With code like this...

//MARK:- Top-Level bad mark
//MARK:- Another bad mark
struct MarkTest {
}
// MARK:- Bad mark
extension MarkTest {
}

swiftlint autocorrect will transform it into this, eating the closing braces. 😋

// MARK: - Top-Level bad mark// MARK: - Another bad mark
struct MarkTest {
// MARK: - Bad mark
extension MarkTest {
}
@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Dec 22, 2016

Collaborator

I couldn't reproduce it with 0.14 😬
Are you using the latest version?

Collaborator

marcelofabri commented Dec 22, 2016

I couldn't reproduce it with 0.14 😬
Are you using the latest version?

@jpsim jpsim added the bug label Dec 22, 2016

@jpsim

This comment has been minimized.

Show comment
Hide comment
@jpsim

jpsim Jan 21, 2017

Collaborator

@ChristopherRogers I'm just following up on @marcelofabri's request for a repro case. If there's a bug here we'd love to know about it!

Collaborator

jpsim commented Jan 21, 2017

@ChristopherRogers I'm just following up on @marcelofabri's request for a repro case. If there's a bug here we'd love to know about it!

@ChristopherRogers

This comment has been minimized.

Show comment
Hide comment
@ChristopherRogers

ChristopherRogers Jan 23, 2017

(Sorry for taking so long to get back; I had been on vacation.)

Sorry, I should've seen if the sample code reproduced the issue first. So, I took a look at the code that was triggering this bug and was able to reduce it to something smaller, which I've placed above. The number of mark comments correlates to the number of characters that are eaten.

The original code doesn't have multiple mark comments on the same type like the code above. Instead it has mark comments placed above methods.

ChristopherRogers commented Jan 23, 2017

(Sorry for taking so long to get back; I had been on vacation.)

Sorry, I should've seen if the sample code reproduced the issue first. So, I took a look at the code that was triggering this bug and was able to reduce it to something smaller, which I've placed above. The number of mark comments correlates to the number of characters that are eaten.

The original code doesn't have multiple mark comments on the same type like the code above. Instead it has mark comments placed above methods.

@marcelofabri

This comment has been minimized.

Show comment
Hide comment
@marcelofabri

marcelofabri Jan 23, 2017

Collaborator

Thanks for the follow up, @ChristopherRogers. I could reproduce it now with 0.16.1.

Collaborator

marcelofabri commented Jan 23, 2017

Thanks for the follow up, @ChristopherRogers. I could reproduce it now with 0.16.1.

@kimdv

This comment has been minimized.

Show comment
Hide comment
@kimdv

kimdv Jul 6, 2017

Can still reproduce this in 0.20.1.

kimdv commented Jul 6, 2017

Can still reproduce this in 0.20.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment