-
Notifications
You must be signed in to change notification settings - Fork 753
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
fix E203 false positive in list slices #1047
base: main
Are you sure you want to change the base?
Conversation
trying this out, it doesn't appear to work properly -- consider $ time python3 -m pycodestyle black/ --exclude black/profiling/,black/tests --ignore=E501,W503,E262,E721,E741 | grep E203
black/src/black/trans.py:653:70: E203 whitespace before ':'
black/src/black/trans.py:727:76: E203 whitespace before ':'
real 0m2.293s
user 0m2.278s
sys 0m0.016s |
Indeed it didn't work with multi line statements |
This comment was marked as off-topic.
This comment was marked as off-topic.
welcome to open source where you get what you pay for! there are no SLAs and no ETAs I'm not even sure this should be merged -- the rule is implemented as intended it's mostly that pep8 changed to stop recommending it -- the original rule should be preserved in some way. though it's not urgent to merge this because there's already a working solution for black (as documented in black's documentation) |
I never saw in pep8's documentation that they recommend not using spaces inside slices. However, they did have vague recommendations to not add spaces before colons, with only examples along the lines of They now (since 2015) have I don't think we should just freeze for the sake of history. If it takes complex checks to ensure we are within the current pep8, so be it. |
Slicing had been widely used since before 2000. maybe you don't remember then but others do. Code exists from then. Styles were adopted and followed since then and enforced with this tool.
Yes, you are in agreement with Anthony that this changed. Congratulations
You're misattributing why we won't change this in a way that seems trollish (deliberately wrong for the purpose of eliciting a response that does what you want). The reality is that many companies and open source projects have code bases not using black relying on this time e for consistency and compliance. This is why it was suggested to create a new rule rather than modify this one. It's not the sake of history, it's the sake of users |
I'm a bit confused by your argument, this PR only removes false positives so there would be no breaking change on code bases not using Black |
People have style guides that conflict with Black and it's influence on current pep-0008. Allowing that whitespace breaks those users who expect consistency enforced by pycodestyle as new code can use either style which isn't what people keeping this enabled want. How is that difficult to understand? |
Sorry, it truly wasn't trollish in my mind.
I can agree with another separate rule, but default behaviour should still be based on current pep8. I would split E203 into two rules:
I don't know if that's been done yet, and if you'd be open to that. Just for the sake of mentioning it, and in case I misunderstood that: Black actually recommends to disable E203 altogether, leaving valuable checks behind. That's not a "working solution" for me, that's worrying. |
it cannot and should not. pep8 is self contradicting and ever changing |
you shouldn't care about the suite of whitespace checks as black is managing that for you |
OK, I guess I understand your point now. In this case, maybe you should close this PR and the corresponding issue. I'll let you get through your decision process on that. |
Resolves #373