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

Spaces used instead of tabs for consecutive spaces in a string #812

Open
jayvdb opened this issue Sep 11, 2016 · 8 comments
Open

Spaces used instead of tabs for consecutive spaces in a string #812

jayvdb opened this issue Sep 11, 2016 · 8 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Sep 11, 2016

When use_spaces = False and allow_trailing_whitespace = True are enabled, "Spaces used instead of tabs." is reported when ever consecutive spaces appear on the line.

This is a little confusing. The message would be more helpful if it was "Consecutive spaces used".

However the bigger problem is that it occurs even when the consecutive spaces are inside a string. Changing the spaces inside a string is not just a style change.

e.g.

test2.php
|  22| »   »   »   »   »   »   "'••'",
|    | [NORMAL] SpaceConsistencyBear:
|    | Line contains following spacing inconsistencies:
|    | - Spaces used instead of tabs.
@gitmate-bot
Copy link
Collaborator

Thanks for reporting this issue! A coalaian will look at it soon.

@sils
Copy link
Member

sils commented Sep 11, 2016

Ah indeed. CC @abhsag24 we could use AnnotationBear as a dependency and avoid strings for languages we know.

@sils
Copy link
Member

sils commented Sep 13, 2016

Or we could just correct trailing/leading whitespace only, as an option.

@jayvdb
Copy link
Member Author

jayvdb commented Sep 14, 2016

Or we could just correct trailing/leading whitespace only, as an option.

This option would need to be enabled by default. Note the problem will also occur if a literal tab is in a string when use_space = True.

@jayvdb
Copy link
Member Author

jayvdb commented Sep 14, 2016

we could use AnnotationBear as a dependency and avoid strings for languages we know.

And de-register SpaceConsistencyBear for languages that coala doesn't know about?
Or emit a scary warning?

@sils
Copy link
Member

sils commented Sep 14, 2016

Sounds sane.

Note the problem will also occur if a literal tab is in a string

Yes, though you then usually want to rather write /t

@jayvdb
Copy link
Member Author

jayvdb commented Sep 14, 2016

Yes, though you then usually want to rather write /t

I was looking for a bear for that. KeywordBear looks related.

@shreyateeza
Copy link
Member

Can anybody please tell me what to do here?

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

No branches or pull requests

5 participants