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

Issue #582: disallow tabs before inline comments #1016

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

spaceone
Copy link
Contributor

Detect invalid tabs before inline comments:

printf 'foo = "bar" \t# comment\n' | pycodestyle -
stdin:1:12: E261 at least two spaces before inline comment
printf 'foo = "bar"\t # comment\n' | pycodestyle -
stdin:1:12: E261 at least two spaces before inline comment
printf 'foo = "bar"\t\t# comment\n' | pycodestyle -
stdin:1:12: E261 at least two spaces before inline comment

Fixes #582

@spaceone spaceone force-pushed the e261-fix-tab-space-mix branch 2 times, most recently from ce8a334 to bb3a941 Compare September 16, 2021 22:51
@spaceone
Copy link
Contributor Author

spaceone commented Oct 4, 2021

any reviewers?

@asottile
Copy link
Member

asottile commented Oct 4, 2021

I don't think this is correct, a space + a tab is "at least two spaces"

@spaceone spaceone force-pushed the e261-fix-tab-space-mix branch from bb3a941 to 19ed280 Compare October 7, 2021 19:55
@spaceone
Copy link
Contributor Author

spaceone commented Oct 7, 2021

Hmm, I don't think so. Why should you mix tabs and spaces?
This is especially annoying in code, which wants to migrate from tabs to spaces - some leftover tabs aren't detected.

Alternatively can I introduce a new error for this?

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

Successfully merging this pull request may close these issues.

E261: ignores tab/space mix
2 participants