Skip to content
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

TODO warning message includes excess leading whitespace #792

Closed
mattrubin opened this issue Aug 31, 2016 · 4 comments
Closed

TODO warning message includes excess leading whitespace #792

mattrubin opened this issue Aug 31, 2016 · 4 comments

Comments

@mattrubin
Copy link
Contributor

With todo warnings enabled, this line

            // TODO: Scroll to the newly-expanded section

becomes this warning:

warning: Todo Violation: TODOs should be avoided             : Scroll to the n... (todo)

The TODO comment is indented to align with the code around it, but the custom message for the todo rule is generated by simply stripping the "TODO" and "//" strings from the line. The leading whitespace and the colon I use in my TODO comments are left in the message, which is then truncated to leave very few useful characters.

The leading whitespace should be removed to allow more room for content in the message. Instead of trying to extract the important subset of the text from the line, the rule could simply strip the "//" and the preceding characters and give this warning:

warning: Todo Violation: TODO: Scroll to the newly-expanded section (todo)
@wbagdon
Copy link
Contributor

wbagdon commented Sep 1, 2016

Resolved with #801

@norio-nomura
Copy link
Collaborator

confirmed that this issue has been resolved.

@msaveleva
Copy link

swiftlint 0.12.0 – still have this issue.

@wbagdon
Copy link
Contributor

wbagdon commented Oct 28, 2016

It's fixed in master.
Will be included in the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants