Closed miketheman closed 8 years ago
Thanks for logging this. Yeah, that's definitely an issue--tailor shouldn't do any indentation checking for code inside a string.
FWIW, for helping narrow down where the problem is coming from, you can turn on tailor logging:
tailor -d
(I wasn't thinking and overrided ruby's -d flag)Tailor::Logger.log = true
If you use this with anything but a really short file, you'll get tons of output, but sometimes that's what's needed... If I run with this on, I see the following, which doesn't look quite right:
[2013-01-09 09:31:49] <Lexer> 2[14]: LBRACKET: '['
[2013-01-09 09:31:49] <IndentationManager> Token '[' not used as a modifier.
[2013-01-09 09:31:49] <IndentationManager> Added indent reason; it's now:
[2013-01-09 09:31:49] <IndentationManager> {:event_type=>:on_lbracket, :token=>"[", :lineno=>2, :should_be_at=>0}
It's been a while since I've been in this code, but IIRC the IndentationManager (used by the IndentationSpacesRuler) shouldn't be updating any rules when it's parsing a string.
Sorry, I incorrectly associated that last commit with this issue.
Aw, shucks. :)
Gotta love reminders that the dev still hasn't fixed your bug, right? :)
Best part of my day.
Closing this old issue. I can't repro, my code is a little out of whack, and I use another popular library these days.
Thanks @miketheman.
and I use another popular library these days.
Me too. :)
Took me a bit to figure this one out.
A %Q string including a string interpolated with a hash-accessed key returns incorrect indentation message.
Take these three examples:
Provides:
The indentation is indeed correct, something about having the braces/single quotes triggers this.
No idea where to look for something like this.