Closed DG0BAB closed 3 years ago
Maybe related to #1893
Hey @DG0BAB,
would you happen to have the exact lint message on this one? Would like to verify whether that's a regression of my PR on SourceKitten.
Thanks!
Hey! @sirlantis sorry for the delay. Currently I can't reproduce this anymore. The code above doesn't exist in that way any longer. Other switch case constructs, indented with tabs, don't trigger the alignment violation. As soon as I have another example I post it here including the lint message.
Hi! I think that I am suffering the same issue...a switch case, constructed with tabs, triggers alignment violation for same of the cases 😳. Example:
I am seeing the issue in several switches. Any idea?
Thx!
@dregatos, in your screenshot, only some cases caused errors. Are all of them tabulated, or just some?
What are the exact scalars preceding switch
, and preceding each failing case
?
For example, maybe one is [SP][HT]
while another is [HT]
. That would line up visually, but not logically.
@SDGGiesbrecht, thank you for your time.
I created all the cases by pressing enter
on the previous line, so all of them should have the same indentention. In any case, I solved the issue by aligning to the left all the lines of the switch, using control
+[
, and then re-indenting them, using control
+i
.
Regards, David
@dregatos,
In any case, I solved the issue by aligning to the left all the lines of the switch, using control+[, and then re-indenting them, using control+i.
If that fixed it then there was something unusual about the whitespace in the source.
I should have mentioned it the first time, but if it happens again you can copy and paste the source into this online tool to inspect the scalars and better see what whitespace you actually have:
https://r12a.github.io/uniview/?charlist=%09switch%20{%0A%20%09case%20%2E%2E%2E
That information might help you discover how the oddities are creeping in.
Alegre que podo axudar./Alegre que puedo ajudar.
So is this a confirmed bug?
on a side note: @SDGGiesbrecht, is this spanish? "Alegre que puedo ajudar"? If so, Are you saying "Happy to help" ? then you probably want to say "Alegre de poder ajudarte", then I again I could be wrong since spanish is not really portable across all cultures. :)
@masters3d,
So is this a confirmed bug?
Hard to tell for sure.
However, @DG0BAB, who opened the issue, stated in November 2017 that he could no longer reproduce it. The only comments since then had to do with unexpected whitespace in the source file—SwiftLint was behaving properly.
The bug most likely is gone. (Or it may even have merely been whitespace confusion from the beginning.)
You probably want to say, «Alegre de poder ajudarte.»
Sí. Gracias. Solo hablo un poco español.
This issue has been automatically marked as stale because it has not had any recent activity. Please comment to prevent this issue from being closed. Thank you for your contributions!
New Issue Checklist
Bug Report
Since version 0.23.0 switch/case alignment violations are issued when using tabs for indenting the source code. In our project we always use Tabs for indentation. This worked fine with version 0.21.0 and 0.22.0
Environment
The above code is indented with tabs and triggers an alignment violation even switch and case are correctly aligned.